diff --git a/CASA-auth-token/non-java/package/linux/CASA_auth_token_native.changes b/CASA-auth-token/non-java/package/linux/CASA_auth_token_native.changes index eecf62ab..276cc295 100644 --- a/CASA-auth-token/non-java/package/linux/CASA_auth_token_native.changes +++ b/CASA-auth-token/non-java/package/linux/CASA_auth_token_native.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Sep 14 17:41:40 MDT 2006 - jluciani@novell.com + +- Added rc script for Validate AuthToken Service. + ------------------------------------------------------------------- Thu Sep 14 09:48:54 MDT 2006 - jluciani@novell.com diff --git a/CASA-auth-token/non-java/package/linux/CASA_auth_token_native.spec.in b/CASA-auth-token/non-java/package/linux/CASA_auth_token_native.spec.in index 40eb6b1e..7db935d0 100644 --- a/CASA-auth-token/non-java/package/linux/CASA_auth_token_native.spec.in +++ b/CASA-auth-token/non-java/package/linux/CASA_auth_token_native.spec.in @@ -15,7 +15,7 @@ Name: CASA_auth_token_native %define debug_opt "" URL: http://www.novell.com/products -BuildRequires: CASA-devel apache2-devel expat gcc-c++ glib2-devel krb5-devel libgcc libgssapi libstdc++ libstdc++-devel mono-devel pam-devel pkgconfig update-alternatives java-1_5_0-ibm java-1_5_0-ibm-devel +BuildRequires: CASA-devel apache2-devel expat gcc-c++ glib2-devel krb5-devel libgcc libgssapi libstdc++ libstdc++-devel mono-devel pam-devel pkgconfig update-alternatives java-1_5_0-ibm java-1_5_0-ibm-devel java-1_5_0-ibm-alsa sysvinit insserv %define prefix /usr License: LGPL Group: System/Libraries @@ -26,8 +26,10 @@ Release: 1 Summary: Novell CASA Authentication Token Libraries Source: %{name}-%{version}.tar.bz2 BuildRoot: %{_tmppath}/%{name}-%{version}-build -Requires: expat java-1_5_0-ibm CASA_auth_token_jaas_support +Requires: expat binutils java-1_5_0-ibm CASA_auth_token_jaas_support sysvinit insserv PreReq: %fillup_prereq %insserv_prereq +PreReq: /usr/bin/awk, /usr/bin/test, /bin/grep, /bin/cat, /usr/bin/install, /bin/pwd +PreReq: /usr/sbin/groupadd, /usr/sbin/useradd, /usr/sbin/userdel, /usr/bin/getent %description CASA_auth_token is an authentication token infrastructure with support @@ -162,6 +164,7 @@ install -d -m 755 %{buildroot}/var/lib/CASA/authtoken install -d -m 755 %{buildroot}/var/lib/CASA/authtoken/validate install -d -m 755 %{buildroot}/etc/CASA install -d -m 755 %{buildroot}/etc/CASA/authtoken.d +install -d -m 755 %{buildroot}/etc/CASA/authtoken.d/validate.d install -d -m 755 %{buildroot}/etc/CASA/authtoken.d/modules.d ## CASA_auth_token_native ## @@ -182,10 +185,11 @@ ln -sf libcasa_s_ipc.so.%{bldno} %{buildroot}%{prefix}/%{_lib}/libcasa_s_ipc.so ln -sf libcasa_s_ipc.so.%{bldno} %{buildroot}%{prefix}/%{_lib}/libcasa_s_ipc.so.1 # Bins -install -m 755 bin/%{cfg}/CasaAuthtokenValidateD %{buildroot}%{prefix}/bin/CasaAuthtokenValidateD +install -m 755 bin/%{cfg}/CasaAuthtokenValidateD %{buildroot}%{prefix}/bin/casa_atvd # Others install -m 644 server/AuthTokenValidate/idenTokenProviders/casa/linux/CasaIdentityToken.conf %{buildroot}/etc/CASA/authtoken.d/modules.d/CasaIdentityToken.conf +install -m 755 server/AuthTokenValidate/Svc/linux/CasaAuthtokenValidateD %{buildroot}/etc/init.d/casa_atvd ## CASA_auth_token_pam_support ## # Libs @@ -214,24 +218,131 @@ rm -rf $RPM_BUILD_ROOT ## CASA_auth_token_native ## %pre -# Nothing to do in this pre script + +# Do necessary user and group administration +group_present=`getent group | grep ^casaauth` +if [ -z "$group_present" ] ; then + /usr/sbin/groupadd -r casaauth +fi + +user_present=`getent passwd | grep ^casaatvd` +if [ -z "$user_present" ] ; then + /usr/sbin/useradd -c "casa_atvd System User" -s /bin/false -r -d /var/lib/CASA/authtoken/validate -g casaauth casaatvd 2> /dev/null || : +fi %post /sbin/ldconfig +CAVD_ETC_DIR=/etc/CASA/authtoken.d/validate.d + +setup_casa_atvd_env() +{ + # Save copy of enviroments file if it already exists + if [ -f $CAVD_ETC_DIR/envvars ]; then + mv $CAVD_ETC_DIR/envvars $CAVD_ETC_DIR/envvars.bak + fi + + # Create envvars file + cat > $CAVD_ETC_DIR/envvars <&1 > /dev/null + if [ "x$?" = "x0" ]; then + RVAL=0 + else + RVAL=3 + fi +} + +START_DAEMON_CMD=start_daemon +START_DAEMON_CMD_FLAG=-u +STATUS=MyStatus +LOG_SUCCESS=log_success_msg +LOG_FAILURE=log_failure_msg +LOG_WARNING=log_warning_msg +ECHO= + +DAEMON=/usr/bin/casa_atvd +DAEMON_USER=casaatvd + +StartDAEMON() +{ + # Source the environments file for our daemon + . /etc/CASA/authtoken.d/validate.d/envvars + + # Update the limit parameters + # + # Do not allow for unlimited core dumps if the daemon is automatically + # re-starting crashed processes. + if [ $DAEMON_NO_AUTORESTART_AFTER_CRASH ]; then + if [ $DAEMON_NO_AUTORESTART_AFTER_CRASH -ne 0 ]; then + # Feature disabled, allow core dumping. + ulimit -c unlimited + else + # Check if core dumping is allowed with the feature enabled + if [ $DAEMON_COREDUMPS_WANTED ]; then + ulimit -c unlimited + fi + fi + else + # Check if core dumping is allowed with the feature enabled + if [ $DAEMON_COREDUMPS_WANTED ]; then + ulimit -c unlimited + fi + fi + + ulimit -f unlimited + + # Start the daemon + echo -n "Starting casa_atvd..." + $START_DAEMON_CMD $START_DAEMON_CMD_FLAG $DAEMON_USER $DAEMON -d + RVAL=$? + $ECHO +} + + +StopDAEMON() +{ + echo -n "Stopping casa_atvd..." + killproc $DAEMON + RVAL=$? + $ECHO +} + +case "$1" in +start) + StartDAEMON + ;; +stop) + StopDAEMON + ;; +restart|reload|force-reload) + StopDAEMON + sleep 1 + StartDAEMON + ;; +status) + $STATUS + ;; +*) + echo -n "Usage: $0 " > /dev/stderr + RVAL=1 + ;; +esac + +rc_failed $RVAL +rc_status -v +rc_exit + diff --git a/CASA-auth-token/non-java/server/AuthTokenValidate/Svc/linux/Makefile.am b/CASA-auth-token/non-java/server/AuthTokenValidate/Svc/linux/Makefile.am index 7db4e090..a1040791 100644 --- a/CASA-auth-token/non-java/server/AuthTokenValidate/Svc/linux/Makefile.am +++ b/CASA-auth-token/non-java/server/AuthTokenValidate/Svc/linux/Makefile.am @@ -64,7 +64,7 @@ LDFLAGS = -L$(LIBDIR)/$(TARGET_CFG) -L$(JAVA_LIBDIR) -L$(JAVA_LIBDIR)/classic OBJDIR = ./$(TARGET_CFG)/$(LIB) OBJS = $(addprefix $(OBJDIR)/, $(CFILES:%.c=%.o)) $(addprefix $(OBJDIR)/, $(CPPFILES:%.cpp=%.o)) -EXTRA_DIST = $(CFILES) $(CPPFILES) *.h +EXTRA_DIST = $(CFILES) $(CPPFILES) *.h CasaAuthtokenValidateD CUR_DIR := $(shell pwd) diff --git a/CASA-auth-token/non-java/server/AuthTokenValidate/linux/Makefile.am b/CASA-auth-token/non-java/server/AuthTokenValidate/linux/Makefile.am index 5886277e..8515435e 100644 --- a/CASA-auth-token/non-java/server/AuthTokenValidate/linux/Makefile.am +++ b/CASA-auth-token/non-java/server/AuthTokenValidate/linux/Makefile.am @@ -56,8 +56,11 @@ CSFILES_CSC := INCLUDES = -I. -I.. -I$(CASAINCLUDE) -I../../../include RESOURCES = DEFINES = -fno-strict-aliasing +if LIB64 +DEFINES += -D_LIB64 +endif CFLAGS += $(INCLUDES) $(DEFINES) -LIBS = -lpthread -ldl -lexpat +LIBS = -lpthread -ldl LDFLAGS = -Bsymbolic -shared -Wl,-soname=$(MODULE_NAME).$(MODULE_EXT) -L$(ROOT)/lib/$(TARGET_CFG) OBJDIR = ./$(TARGET_CFG)/$(LIB) diff --git a/CASA-auth-token/non-java/server/AuthTokenValidate/linux/platform.c b/CASA-auth-token/non-java/server/AuthTokenValidate/linux/platform.c index d21a1a92..250d7e6d 100644 --- a/CASA-auth-token/non-java/server/AuthTokenValidate/linux/platform.c +++ b/CASA-auth-token/non-java/server/AuthTokenValidate/linux/platform.c @@ -48,8 +48,12 @@ pthread_mutex_t g_hModuleMutex = PTHREAD_MUTEX_INITIALIZER; // // Ipc client library path -// +// +#ifdef _LIB64 +char IpcClientLibraryPath[] = "/usr/lib64/libcasa_c_ipc.so"; +#else char IpcClientLibraryPath[] = "/usr/lib/libcasa_c_ipc.so"; +#endif //++=======================================================================