trinidad_init_services 1.2.2 → 1.2.3

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -1,3 +1,2 @@
1
- source :rubygems
2
-
1
+ source 'https://rubygems.org'
3
2
  gemspec
data/init.d/trinidad.erb CHANGED
@@ -96,7 +96,7 @@ JAVA_PROPS="$JAVA_PROPS \
96
96
  -Djruby.shell=$JRUBY_SHELL \
97
97
  -Djffi.boot.library.path=$JRUBY_NATIVE_PATH \
98
98
  <%= @jruby_opts.join(' ') %> "
99
-
99
+
100
100
  PROC_NAME=${SCRIPT_NAME:-${APP_NAME:-"trinidad"}}
101
101
 
102
102
  JSVC_ARGS="-home $JAVA_HOME \
@@ -107,7 +107,7 @@ JSVC_ARGS="-home $JAVA_HOME \
107
107
  -jvm server
108
108
  -outfile $LOG_FILE \
109
109
  -errfile &1"
110
-
110
+
111
111
  #
112
112
  # Stop/Start
113
113
  #
@@ -124,8 +124,16 @@ cd $APP_PATH || exit 1
124
124
  case "$1" in
125
125
  start)
126
126
  if [ -e "$PIDFILE" ]; then
127
- echo "Pidfile already exists, not starting."
128
- exit 1
127
+ CUR_PID=$(<"$PIDFILE")
128
+ COM_NAME=$(ps -p $CUR_PID -o command= | cut -d ' ' -f 1)
129
+ PROCESS_NAME="jsvc-$PROC_NAME"
130
+ if [ "$COM_NAME" != "$PROCESS_NAME" ]; then
131
+ rm $PIDFILE
132
+ $START_COMMAND
133
+ else
134
+ echo "Pidfile already exists for pid $CUR_PID, not starting."
135
+ exit 1
136
+ fi
129
137
  else
130
138
  echo "Starting $PROC_NAME daemon..."
131
139
  if [ -n "$ECHO_COMMAND" ]; then echo $START_COMMAND; fi
@@ -167,7 +175,7 @@ case "$1" in
167
175
  status)
168
176
  if [ "$PIDFILE" ]; then
169
177
  PID=`cat $PIDFILE`
170
- OUTPUT=`ps $PID | egrep "^$PID "`
178
+ OUTPUT=`ps -o pid $PID | grep "$PID"`
171
179
  if [ ${#OUTPUT} -gt 0 ]; then
172
180
  echo "Service running with pid: $PID"
173
181
  else
@@ -272,44 +272,7 @@ PACKAGE_STRING=
272
272
  PACKAGE_BUGREPORT=
273
273
 
274
274
  ac_unique_file="configure.in"
275
- # Factoring default headers for most tests.
276
- ac_includes_default="\
277
- #include <stdio.h>
278
- #if HAVE_SYS_TYPES_H
279
- # include <sys/types.h>
280
- #endif
281
- #if HAVE_SYS_STAT_H
282
- # include <sys/stat.h>
283
- #endif
284
- #if STDC_HEADERS
285
- # include <stdlib.h>
286
- # include <stddef.h>
287
- #else
288
- # if HAVE_STDLIB_H
289
- # include <stdlib.h>
290
- # endif
291
- #endif
292
- #if HAVE_STRING_H
293
- # if !STDC_HEADERS && HAVE_MEMORY_H
294
- # include <memory.h>
295
- # endif
296
- # include <string.h>
297
- #endif
298
- #if HAVE_STRINGS_H
299
- # include <strings.h>
300
- #endif
301
- #if HAVE_INTTYPES_H
302
- # include <inttypes.h>
303
- #else
304
- # if HAVE_STDINT_H
305
- # include <stdint.h>
306
- # endif
307
- #endif
308
- #if HAVE_UNISTD_H
309
- # include <unistd.h>
310
- #endif"
311
-
312
- 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 build build_cpu build_vendor build_os host host_cpu host_vendor host_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT RANLIB ac_ct_RANLIB STRIP ac_ct_STRIP JAVA_HOME LDCMD CPP EGREP INCLUDES LIBOBJS LTLIBOBJS'
275
+ 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 build build_cpu build_vendor build_os host host_cpu host_vendor host_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT RANLIB ac_ct_RANLIB STRIP ac_ct_STRIP JAVA_HOME LDCMD INCLUDES LIBOBJS LTLIBOBJS'
313
276
  ac_subst_files=''
314
277
 
315
278
  # Initialize some variables set by options.
@@ -766,10 +729,6 @@ ac_env_CPPFLAGS_set=${CPPFLAGS+set}
766
729
  ac_env_CPPFLAGS_value=$CPPFLAGS
767
730
  ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
768
731
  ac_cv_env_CPPFLAGS_value=$CPPFLAGS
769
- ac_env_CPP_set=${CPP+set}
770
- ac_env_CPP_value=$CPP
771
- ac_cv_env_CPP_set=${CPP+set}
772
- ac_cv_env_CPP_value=$CPP
773
732
 
774
733
  #
775
734
  # Report the --help message.
@@ -854,7 +813,6 @@ Some influential environment variables:
854
813
  nonstandard directory <lib dir>
855
814
  CPPFLAGS C/C++ preprocessor flags, e.g. -I<include dir> if you have
856
815
  headers in a nonstandard directory <include dir>
857
- CPP C preprocessor
858
816
 
859
817
  Use these variables to override the choices made by `configure' or to help
860
818
  it to find libraries and programs with nonstandard names/locations.
@@ -2835,454 +2793,38 @@ fi
2835
2793
  if test "$supported_os" = "linux"
2836
2794
  then
2837
2795
 
2838
- ac_ext=c
2839
- ac_cpp='$CPP $CPPFLAGS'
2840
- ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2841
- ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2842
- ac_compiler_gnu=$ac_cv_c_compiler_gnu
2843
- echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
2844
- echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
2845
- # On Suns, sometimes $CPP names a directory.
2846
- if test -n "$CPP" && test -d "$CPP"; then
2847
- CPP=
2848
- fi
2849
- if test -z "$CPP"; then
2850
- if test "${ac_cv_prog_CPP+set}" = set; then
2796
+ echo "$as_me:$LINENO: checking for cap_init in -lcap" >&5
2797
+ echo $ECHO_N "checking for cap_init in -lcap... $ECHO_C" >&6
2798
+ if test "${ac_cv_lib_cap_cap_init+set}" = set; then
2851
2799
  echo $ECHO_N "(cached) $ECHO_C" >&6
2852
2800
  else
2853
- # Double quotes because CPP needs to be expanded
2854
- for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
2855
- do
2856
- ac_preproc_ok=false
2857
- for ac_c_preproc_warn_flag in '' yes
2858
- do
2859
- # Use a header file that comes with gcc, so configuring glibc
2860
- # with a fresh cross-compiler works.
2861
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
2862
- # <limits.h> exists even on freestanding compilers.
2863
- # On the NeXT, cc -E runs the code through the compiler's parser,
2864
- # not just through cpp. "Syntax error" is here to catch this case.
2865
- cat >conftest.$ac_ext <<_ACEOF
2866
- /* confdefs.h. */
2867
- _ACEOF
2868
- cat confdefs.h >>conftest.$ac_ext
2869
- cat >>conftest.$ac_ext <<_ACEOF
2870
- /* end confdefs.h. */
2871
- #ifdef __STDC__
2872
- # include <limits.h>
2873
- #else
2874
- # include <assert.h>
2875
- #endif
2876
- Syntax error
2877
- _ACEOF
2878
- if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
2879
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2880
- ac_status=$?
2881
- grep -v '^ *+' conftest.er1 >conftest.err
2882
- rm -f conftest.er1
2883
- cat conftest.err >&5
2884
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
2885
- (exit $ac_status); } >/dev/null; then
2886
- if test -s conftest.err; then
2887
- ac_cpp_err=$ac_c_preproc_warn_flag
2888
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
2889
- else
2890
- ac_cpp_err=
2891
- fi
2892
- else
2893
- ac_cpp_err=yes
2894
- fi
2895
- if test -z "$ac_cpp_err"; then
2896
- :
2897
- else
2898
- echo "$as_me: failed program was:" >&5
2899
- sed 's/^/| /' conftest.$ac_ext >&5
2900
-
2901
- # Broken: fails on valid input.
2902
- continue
2903
- fi
2904
- rm -f conftest.err conftest.$ac_ext
2905
-
2906
- # OK, works on sane cases. Now check whether non-existent headers
2907
- # can be detected and how.
2908
- cat >conftest.$ac_ext <<_ACEOF
2801
+ ac_check_lib_save_LIBS=$LIBS
2802
+ LIBS="-lcap $LIBS"
2803
+ cat >conftest.$ac_ext <<_ACEOF
2909
2804
  /* confdefs.h. */
2910
2805
  _ACEOF
2911
2806
  cat confdefs.h >>conftest.$ac_ext
2912
2807
  cat >>conftest.$ac_ext <<_ACEOF
2913
2808
  /* end confdefs.h. */
2914
- #include <ac_nonexistent.h>
2915
- _ACEOF
2916
- if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
2917
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2918
- ac_status=$?
2919
- grep -v '^ *+' conftest.er1 >conftest.err
2920
- rm -f conftest.er1
2921
- cat conftest.err >&5
2922
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
2923
- (exit $ac_status); } >/dev/null; then
2924
- if test -s conftest.err; then
2925
- ac_cpp_err=$ac_c_preproc_warn_flag
2926
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
2927
- else
2928
- ac_cpp_err=
2929
- fi
2930
- else
2931
- ac_cpp_err=yes
2932
- fi
2933
- if test -z "$ac_cpp_err"; then
2934
- # Broken: success on invalid input.
2935
- continue
2936
- else
2937
- echo "$as_me: failed program was:" >&5
2938
- sed 's/^/| /' conftest.$ac_ext >&5
2939
-
2940
- # Passes both tests.
2941
- ac_preproc_ok=:
2942
- break
2943
- fi
2944
- rm -f conftest.err conftest.$ac_ext
2945
-
2946
- done
2947
- # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2948
- rm -f conftest.err conftest.$ac_ext
2949
- if $ac_preproc_ok; then
2950
- break
2951
- fi
2952
-
2953
- done
2954
- ac_cv_prog_CPP=$CPP
2955
2809
 
2956
- fi
2957
- CPP=$ac_cv_prog_CPP
2958
- else
2959
- ac_cv_prog_CPP=$CPP
2960
- fi
2961
- echo "$as_me:$LINENO: result: $CPP" >&5
2962
- echo "${ECHO_T}$CPP" >&6
2963
- ac_preproc_ok=false
2964
- for ac_c_preproc_warn_flag in '' yes
2965
- do
2966
- # Use a header file that comes with gcc, so configuring glibc
2967
- # with a fresh cross-compiler works.
2968
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
2969
- # <limits.h> exists even on freestanding compilers.
2970
- # On the NeXT, cc -E runs the code through the compiler's parser,
2971
- # not just through cpp. "Syntax error" is here to catch this case.
2972
- cat >conftest.$ac_ext <<_ACEOF
2973
- /* confdefs.h. */
2974
- _ACEOF
2975
- cat confdefs.h >>conftest.$ac_ext
2976
- cat >>conftest.$ac_ext <<_ACEOF
2977
- /* end confdefs.h. */
2978
- #ifdef __STDC__
2979
- # include <limits.h>
2980
- #else
2981
- # include <assert.h>
2810
+ /* Override any gcc2 internal prototype to avoid an error. */
2811
+ #ifdef __cplusplus
2812
+ extern "C"
2982
2813
  #endif
2983
- Syntax error
2984
- _ACEOF
2985
- if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
2986
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2987
- ac_status=$?
2988
- grep -v '^ *+' conftest.er1 >conftest.err
2989
- rm -f conftest.er1
2990
- cat conftest.err >&5
2991
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
2992
- (exit $ac_status); } >/dev/null; then
2993
- if test -s conftest.err; then
2994
- ac_cpp_err=$ac_c_preproc_warn_flag
2995
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
2996
- else
2997
- ac_cpp_err=
2998
- fi
2999
- else
3000
- ac_cpp_err=yes
3001
- fi
3002
- if test -z "$ac_cpp_err"; then
3003
- :
3004
- else
3005
- echo "$as_me: failed program was:" >&5
3006
- sed 's/^/| /' conftest.$ac_ext >&5
3007
-
3008
- # Broken: fails on valid input.
3009
- continue
3010
- fi
3011
- rm -f conftest.err conftest.$ac_ext
3012
-
3013
- # OK, works on sane cases. Now check whether non-existent headers
3014
- # can be detected and how.
3015
- cat >conftest.$ac_ext <<_ACEOF
3016
- /* confdefs.h. */
3017
- _ACEOF
3018
- cat confdefs.h >>conftest.$ac_ext
3019
- cat >>conftest.$ac_ext <<_ACEOF
3020
- /* end confdefs.h. */
3021
- #include <ac_nonexistent.h>
3022
- _ACEOF
3023
- if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
3024
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
3025
- ac_status=$?
3026
- grep -v '^ *+' conftest.er1 >conftest.err
3027
- rm -f conftest.er1
3028
- cat conftest.err >&5
3029
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
3030
- (exit $ac_status); } >/dev/null; then
3031
- if test -s conftest.err; then
3032
- ac_cpp_err=$ac_c_preproc_warn_flag
3033
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
3034
- else
3035
- ac_cpp_err=
3036
- fi
3037
- else
3038
- ac_cpp_err=yes
3039
- fi
3040
- if test -z "$ac_cpp_err"; then
3041
- # Broken: success on invalid input.
3042
- continue
3043
- else
3044
- echo "$as_me: failed program was:" >&5
3045
- sed 's/^/| /' conftest.$ac_ext >&5
3046
-
3047
- # Passes both tests.
3048
- ac_preproc_ok=:
3049
- break
3050
- fi
3051
- rm -f conftest.err conftest.$ac_ext
3052
-
3053
- done
3054
- # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
3055
- rm -f conftest.err conftest.$ac_ext
3056
- if $ac_preproc_ok; then
3057
- :
3058
- else
3059
- { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
3060
- See \`config.log' for more details." >&5
3061
- echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
3062
- See \`config.log' for more details." >&2;}
3063
- { (exit 1); exit 1; }; }
3064
- fi
3065
-
3066
- ac_ext=c
3067
- ac_cpp='$CPP $CPPFLAGS'
3068
- ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
3069
- ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
3070
- ac_compiler_gnu=$ac_cv_c_compiler_gnu
3071
-
3072
-
3073
- echo "$as_me:$LINENO: checking for egrep" >&5
3074
- echo $ECHO_N "checking for egrep... $ECHO_C" >&6
3075
- if test "${ac_cv_prog_egrep+set}" = set; then
3076
- echo $ECHO_N "(cached) $ECHO_C" >&6
3077
- else
3078
- if echo a | (grep -E '(a|b)') >/dev/null 2>&1
3079
- then ac_cv_prog_egrep='grep -E'
3080
- else ac_cv_prog_egrep='egrep'
3081
- fi
3082
- fi
3083
- echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5
3084
- echo "${ECHO_T}$ac_cv_prog_egrep" >&6
3085
- EGREP=$ac_cv_prog_egrep
3086
-
3087
-
3088
- echo "$as_me:$LINENO: checking for ANSI C header files" >&5
3089
- echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
3090
- if test "${ac_cv_header_stdc+set}" = set; then
3091
- echo $ECHO_N "(cached) $ECHO_C" >&6
3092
- else
3093
- cat >conftest.$ac_ext <<_ACEOF
3094
- /* confdefs.h. */
3095
- _ACEOF
3096
- cat confdefs.h >>conftest.$ac_ext
3097
- cat >>conftest.$ac_ext <<_ACEOF
3098
- /* end confdefs.h. */
3099
- #include <stdlib.h>
3100
- #include <stdarg.h>
3101
- #include <string.h>
3102
- #include <float.h>
3103
-
2814
+ /* We use char because int might match the return type of a gcc2
2815
+ builtin and then its argument prototype would still apply. */
2816
+ char cap_init ();
3104
2817
  int
3105
2818
  main ()
3106
2819
  {
3107
-
2820
+ cap_init ();
3108
2821
  ;
3109
2822
  return 0;
3110
2823
  }
3111
2824
  _ACEOF
3112
- rm -f conftest.$ac_objext
3113
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
3114
- (eval $ac_compile) 2>conftest.er1
3115
- ac_status=$?
3116
- grep -v '^ *+' conftest.er1 >conftest.err
3117
- rm -f conftest.er1
3118
- cat conftest.err >&5
3119
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
3120
- (exit $ac_status); } &&
3121
- { ac_try='test -z "$ac_c_werror_flag"
3122
- || test ! -s conftest.err'
3123
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
3124
- (eval $ac_try) 2>&5
3125
- ac_status=$?
3126
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
3127
- (exit $ac_status); }; } &&
3128
- { ac_try='test -s conftest.$ac_objext'
3129
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
3130
- (eval $ac_try) 2>&5
3131
- ac_status=$?
3132
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
3133
- (exit $ac_status); }; }; then
3134
- ac_cv_header_stdc=yes
3135
- else
3136
- echo "$as_me: failed program was:" >&5
3137
- sed 's/^/| /' conftest.$ac_ext >&5
3138
-
3139
- ac_cv_header_stdc=no
3140
- fi
3141
- rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
3142
-
3143
- if test $ac_cv_header_stdc = yes; then
3144
- # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
3145
- cat >conftest.$ac_ext <<_ACEOF
3146
- /* confdefs.h. */
3147
- _ACEOF
3148
- cat confdefs.h >>conftest.$ac_ext
3149
- cat >>conftest.$ac_ext <<_ACEOF
3150
- /* end confdefs.h. */
3151
- #include <string.h>
3152
-
3153
- _ACEOF
3154
- if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3155
- $EGREP "memchr" >/dev/null 2>&1; then
3156
- :
3157
- else
3158
- ac_cv_header_stdc=no
3159
- fi
3160
- rm -f conftest*
3161
-
3162
- fi
3163
-
3164
- if test $ac_cv_header_stdc = yes; then
3165
- # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
3166
- cat >conftest.$ac_ext <<_ACEOF
3167
- /* confdefs.h. */
3168
- _ACEOF
3169
- cat confdefs.h >>conftest.$ac_ext
3170
- cat >>conftest.$ac_ext <<_ACEOF
3171
- /* end confdefs.h. */
3172
- #include <stdlib.h>
3173
-
3174
- _ACEOF
3175
- if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3176
- $EGREP "free" >/dev/null 2>&1; then
3177
- :
3178
- else
3179
- ac_cv_header_stdc=no
3180
- fi
3181
- rm -f conftest*
3182
-
3183
- fi
3184
-
3185
- if test $ac_cv_header_stdc = yes; then
3186
- # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
3187
- if test "$cross_compiling" = yes; then
3188
- :
3189
- else
3190
- cat >conftest.$ac_ext <<_ACEOF
3191
- /* confdefs.h. */
3192
- _ACEOF
3193
- cat confdefs.h >>conftest.$ac_ext
3194
- cat >>conftest.$ac_ext <<_ACEOF
3195
- /* end confdefs.h. */
3196
- #include <ctype.h>
3197
- #if ((' ' & 0x0FF) == 0x020)
3198
- # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
3199
- # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
3200
- #else
3201
- # define ISLOWER(c) \
3202
- (('a' <= (c) && (c) <= 'i') \
3203
- || ('j' <= (c) && (c) <= 'r') \
3204
- || ('s' <= (c) && (c) <= 'z'))
3205
- # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
3206
- #endif
3207
-
3208
- #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
3209
- int
3210
- main ()
3211
- {
3212
- int i;
3213
- for (i = 0; i < 256; i++)
3214
- if (XOR (islower (i), ISLOWER (i))
3215
- || toupper (i) != TOUPPER (i))
3216
- exit(2);
3217
- exit (0);
3218
- }
3219
- _ACEOF
3220
- rm -f conftest$ac_exeext
2825
+ rm -f conftest.$ac_objext conftest$ac_exeext
3221
2826
  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
3222
- (eval $ac_link) 2>&5
3223
- ac_status=$?
3224
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
3225
- (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
3226
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
3227
- (eval $ac_try) 2>&5
3228
- ac_status=$?
3229
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
3230
- (exit $ac_status); }; }; then
3231
- :
3232
- else
3233
- echo "$as_me: program exited with status $ac_status" >&5
3234
- echo "$as_me: failed program was:" >&5
3235
- sed 's/^/| /' conftest.$ac_ext >&5
3236
-
3237
- ( exit $ac_status )
3238
- ac_cv_header_stdc=no
3239
- fi
3240
- rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
3241
- fi
3242
- fi
3243
- fi
3244
- echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
3245
- echo "${ECHO_T}$ac_cv_header_stdc" >&6
3246
- if test $ac_cv_header_stdc = yes; then
3247
-
3248
- cat >>confdefs.h <<\_ACEOF
3249
- #define STDC_HEADERS 1
3250
- _ACEOF
3251
-
3252
- fi
3253
-
3254
- # On IRIX 5.3, sys/types and inttypes.h are conflicting.
3255
-
3256
-
3257
-
3258
-
3259
-
3260
-
3261
-
3262
-
3263
-
3264
- for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
3265
- inttypes.h stdint.h unistd.h
3266
- do
3267
- as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
3268
- echo "$as_me:$LINENO: checking for $ac_header" >&5
3269
- echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
3270
- if eval "test \"\${$as_ac_Header+set}\" = set"; then
3271
- echo $ECHO_N "(cached) $ECHO_C" >&6
3272
- else
3273
- cat >conftest.$ac_ext <<_ACEOF
3274
- /* confdefs.h. */
3275
- _ACEOF
3276
- cat confdefs.h >>conftest.$ac_ext
3277
- cat >>conftest.$ac_ext <<_ACEOF
3278
- /* end confdefs.h. */
3279
- $ac_includes_default
3280
-
3281
- #include <$ac_header>
3282
- _ACEOF
3283
- rm -f conftest.$ac_objext
3284
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
3285
- (eval $ac_compile) 2>conftest.er1
2827
+ (eval $ac_link) 2>conftest.er1
3286
2828
  ac_status=$?
3287
2829
  grep -v '^ *+' conftest.er1 >conftest.err
3288
2830
  rm -f conftest.er1
@@ -3296,177 +2838,28 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
3296
2838
  ac_status=$?
3297
2839
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
3298
2840
  (exit $ac_status); }; } &&
3299
- { ac_try='test -s conftest.$ac_objext'
2841
+ { ac_try='test -s conftest$ac_exeext'
3300
2842
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
3301
2843
  (eval $ac_try) 2>&5
3302
2844
  ac_status=$?
3303
2845
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
3304
2846
  (exit $ac_status); }; }; then
3305
- eval "$as_ac_Header=yes"
2847
+ ac_cv_lib_cap_cap_init=yes
3306
2848
  else
3307
2849
  echo "$as_me: failed program was:" >&5
3308
2850
  sed 's/^/| /' conftest.$ac_ext >&5
3309
2851
 
3310
- eval "$as_ac_Header=no"
3311
- fi
3312
- rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
2852
+ ac_cv_lib_cap_cap_init=no
3313
2853
  fi
3314
- echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
3315
- echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
3316
- if test `eval echo '${'$as_ac_Header'}'` = yes; then
3317
- cat >>confdefs.h <<_ACEOF
3318
- #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
3319
- _ACEOF
3320
-
2854
+ rm -f conftest.err conftest.$ac_objext \
2855
+ conftest$ac_exeext conftest.$ac_ext
2856
+ LIBS=$ac_check_lib_save_LIBS
3321
2857
  fi
3322
-
3323
- done
3324
-
3325
-
3326
- if test "${ac_cv_header_sys_capability_h+set}" = set; then
3327
- echo "$as_me:$LINENO: checking for sys/capability.h" >&5
3328
- echo $ECHO_N "checking for sys/capability.h... $ECHO_C" >&6
3329
- if test "${ac_cv_header_sys_capability_h+set}" = set; then
3330
- echo $ECHO_N "(cached) $ECHO_C" >&6
2858
+ echo "$as_me:$LINENO: result: $ac_cv_lib_cap_cap_init" >&5
2859
+ echo "${ECHO_T}$ac_cv_lib_cap_cap_init" >&6
2860
+ if test $ac_cv_lib_cap_cap_init = yes; then
2861
+ CFLAGS="$CFLAGS -DHAVE_LIBCAP" ; LIBS="$LIBS -lcap"
3331
2862
  fi
3332
- echo "$as_me:$LINENO: result: $ac_cv_header_sys_capability_h" >&5
3333
- echo "${ECHO_T}$ac_cv_header_sys_capability_h" >&6
3334
- else
3335
- # Is the header compilable?
3336
- echo "$as_me:$LINENO: checking sys/capability.h usability" >&5
3337
- echo $ECHO_N "checking sys/capability.h usability... $ECHO_C" >&6
3338
- cat >conftest.$ac_ext <<_ACEOF
3339
- /* confdefs.h. */
3340
- _ACEOF
3341
- cat confdefs.h >>conftest.$ac_ext
3342
- cat >>conftest.$ac_ext <<_ACEOF
3343
- /* end confdefs.h. */
3344
- $ac_includes_default
3345
- #include <sys/capability.h>
3346
- _ACEOF
3347
- rm -f conftest.$ac_objext
3348
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
3349
- (eval $ac_compile) 2>conftest.er1
3350
- ac_status=$?
3351
- grep -v '^ *+' conftest.er1 >conftest.err
3352
- rm -f conftest.er1
3353
- cat conftest.err >&5
3354
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
3355
- (exit $ac_status); } &&
3356
- { ac_try='test -z "$ac_c_werror_flag"
3357
- || test ! -s conftest.err'
3358
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
3359
- (eval $ac_try) 2>&5
3360
- ac_status=$?
3361
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
3362
- (exit $ac_status); }; } &&
3363
- { ac_try='test -s conftest.$ac_objext'
3364
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
3365
- (eval $ac_try) 2>&5
3366
- ac_status=$?
3367
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
3368
- (exit $ac_status); }; }; then
3369
- ac_header_compiler=yes
3370
- else
3371
- echo "$as_me: failed program was:" >&5
3372
- sed 's/^/| /' conftest.$ac_ext >&5
3373
-
3374
- ac_header_compiler=no
3375
- fi
3376
- rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
3377
- echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
3378
- echo "${ECHO_T}$ac_header_compiler" >&6
3379
-
3380
- # Is the header present?
3381
- echo "$as_me:$LINENO: checking sys/capability.h presence" >&5
3382
- echo $ECHO_N "checking sys/capability.h presence... $ECHO_C" >&6
3383
- cat >conftest.$ac_ext <<_ACEOF
3384
- /* confdefs.h. */
3385
- _ACEOF
3386
- cat confdefs.h >>conftest.$ac_ext
3387
- cat >>conftest.$ac_ext <<_ACEOF
3388
- /* end confdefs.h. */
3389
- #include <sys/capability.h>
3390
- _ACEOF
3391
- if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
3392
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
3393
- ac_status=$?
3394
- grep -v '^ *+' conftest.er1 >conftest.err
3395
- rm -f conftest.er1
3396
- cat conftest.err >&5
3397
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
3398
- (exit $ac_status); } >/dev/null; then
3399
- if test -s conftest.err; then
3400
- ac_cpp_err=$ac_c_preproc_warn_flag
3401
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
3402
- else
3403
- ac_cpp_err=
3404
- fi
3405
- else
3406
- ac_cpp_err=yes
3407
- fi
3408
- if test -z "$ac_cpp_err"; then
3409
- ac_header_preproc=yes
3410
- else
3411
- echo "$as_me: failed program was:" >&5
3412
- sed 's/^/| /' conftest.$ac_ext >&5
3413
-
3414
- ac_header_preproc=no
3415
- fi
3416
- rm -f conftest.err conftest.$ac_ext
3417
- echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
3418
- echo "${ECHO_T}$ac_header_preproc" >&6
3419
-
3420
- # So? What about this header?
3421
- case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
3422
- yes:no: )
3423
- { echo "$as_me:$LINENO: WARNING: sys/capability.h: accepted by the compiler, rejected by the preprocessor!" >&5
3424
- echo "$as_me: WARNING: sys/capability.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
3425
- { echo "$as_me:$LINENO: WARNING: sys/capability.h: proceeding with the compiler's result" >&5
3426
- echo "$as_me: WARNING: sys/capability.h: proceeding with the compiler's result" >&2;}
3427
- ac_header_preproc=yes
3428
- ;;
3429
- no:yes:* )
3430
- { echo "$as_me:$LINENO: WARNING: sys/capability.h: present but cannot be compiled" >&5
3431
- echo "$as_me: WARNING: sys/capability.h: present but cannot be compiled" >&2;}
3432
- { echo "$as_me:$LINENO: WARNING: sys/capability.h: check for missing prerequisite headers?" >&5
3433
- echo "$as_me: WARNING: sys/capability.h: check for missing prerequisite headers?" >&2;}
3434
- { echo "$as_me:$LINENO: WARNING: sys/capability.h: see the Autoconf documentation" >&5
3435
- echo "$as_me: WARNING: sys/capability.h: see the Autoconf documentation" >&2;}
3436
- { echo "$as_me:$LINENO: WARNING: sys/capability.h: section \"Present But Cannot Be Compiled\"" >&5
3437
- echo "$as_me: WARNING: sys/capability.h: section \"Present But Cannot Be Compiled\"" >&2;}
3438
- { echo "$as_me:$LINENO: WARNING: sys/capability.h: proceeding with the preprocessor's result" >&5
3439
- echo "$as_me: WARNING: sys/capability.h: proceeding with the preprocessor's result" >&2;}
3440
- { echo "$as_me:$LINENO: WARNING: sys/capability.h: in the future, the compiler will take precedence" >&5
3441
- echo "$as_me: WARNING: sys/capability.h: in the future, the compiler will take precedence" >&2;}
3442
- (
3443
- cat <<\_ASBOX
3444
- ## ------------------------------------------ ##
3445
- ## Report this to the AC_PACKAGE_NAME lists. ##
3446
- ## ------------------------------------------ ##
3447
- _ASBOX
3448
- ) |
3449
- sed "s/^/$as_me: WARNING: /" >&2
3450
- ;;
3451
- esac
3452
- echo "$as_me:$LINENO: checking for sys/capability.h" >&5
3453
- echo $ECHO_N "checking for sys/capability.h... $ECHO_C" >&6
3454
- if test "${ac_cv_header_sys_capability_h+set}" = set; then
3455
- echo $ECHO_N "(cached) $ECHO_C" >&6
3456
- else
3457
- ac_cv_header_sys_capability_h=$ac_header_preproc
3458
- fi
3459
- echo "$as_me:$LINENO: result: $ac_cv_header_sys_capability_h" >&5
3460
- echo "${ECHO_T}$ac_cv_header_sys_capability_h" >&6
3461
-
3462
- fi
3463
- if test $ac_cv_header_sys_capability_h = yes; then
3464
- CFLAGS="$CFLAGS -DHAVE_LIBCAP"
3465
- else
3466
- { echo "$as_me:$LINENO: WARNING: cannot find headers for libcap" >&5
3467
- echo "$as_me: WARNING: cannot find headers for libcap" >&2;}
3468
- fi
3469
-
3470
2863
 
3471
2864
  fi
3472
2865
 
@@ -4140,8 +3533,6 @@ s,@STRIP@,$STRIP,;t t
4140
3533
  s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t
4141
3534
  s,@JAVA_HOME@,$JAVA_HOME,;t t
4142
3535
  s,@LDCMD@,$LDCMD,;t t
4143
- s,@CPP@,$CPP,;t t
4144
- s,@EGREP@,$EGREP,;t t
4145
3536
  s,@INCLUDES@,$INCLUDES,;t t
4146
3537
  s,@LIBOBJS@,$LIBOBJS,;t t
4147
3538
  s,@LTLIBOBJS@,$LTLIBOBJS,;t t
@@ -17,7 +17,7 @@ dnl
17
17
 
18
18
  dnl -------------------------------------------------------------------------
19
19
  dnl Author Pier Fumagalli <mailto:pier.fumagalli@eng.sun.com>
20
- dnl Version $Id: configure.in 1292683 2012-02-23 07:37:10Z mturk $
20
+ dnl Version $Id: configure.in 1411560 2012-11-20 06:30:13Z mturk $
21
21
  dnl -------------------------------------------------------------------------
22
22
 
23
23
  dnl -------------------------------------------------------------------------
@@ -59,8 +59,12 @@ AP_MSG_HEADER([Host support])
59
59
  AP_SUPPORTED_HOST()
60
60
  if test "$supported_os" = "darwin"
61
61
  then
62
+ if test -z "$JAVA_HOME" -a -x /usr/libexec/java_home
63
+ then
64
+ JAVA_HOME="`/usr/libexec/java_home 2>dev/null`"
65
+ fi
62
66
  if test -z "$JAVA_HOME" -a -d /System/Library/Frameworks/JavaVM.framework/Home; then
63
- JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Home
67
+ JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Home
64
68
  fi
65
69
 
66
70
  _prevdir=`/bin/pwd`
@@ -14,7 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- /* @version $Id: arguments.c 1196468 2011-11-02 06:24:11Z mturk $ */
17
+ /* @version $Id: arguments.c 1412037 2012-11-21 10:01:22Z mturk $ */
18
18
  #include "jsvc.h"
19
19
  #include <limits.h>
20
20
  #include <glob.h>
@@ -167,6 +167,7 @@ static arg_data *parse(int argc, char *argv[])
167
167
  args->onum = 0; /* Zero arguments, but let's have some room */
168
168
  args->clas = NULL; /* No class predefined */
169
169
  args->anum = 0; /* Zero class specific arguments but make room*/
170
+ args->cwd = "/"; /* Use root as default */
170
171
  args->outfile = "/dev/null"; /* Swallow by default */
171
172
  args->errfile = "/dev/null"; /* Swallow by default */
172
173
  args->redirectstdin = true; /* Redirect stdin to /dev/null by default */
@@ -237,6 +238,13 @@ static arg_data *parse(int argc, char *argv[])
237
238
  return NULL;
238
239
  }
239
240
  }
241
+ else if (!strcmp(argv[x], "-cwd")) {
242
+ args->cwd = optional(argc, argv, x++);
243
+ if (args->cwd == NULL) {
244
+ log_error("Invalid working directory specified");
245
+ return NULL;
246
+ }
247
+ }
240
248
  else if (!strcmp(argv[x], "-version")) {
241
249
  args->vers = true;
242
250
  args->dtch = false;
@@ -14,7 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- /* @version $Id: arguments.h 1196265 2011-11-01 20:43:52Z mturk $ */
17
+ /* @version $Id: arguments.h 1412037 2012-11-21 10:01:22Z mturk $ */
18
18
  #ifndef __JSVC_ARGUMENTS_H__
19
19
  #define __JSVC_ARGUMENTS_H__
20
20
 
@@ -35,6 +35,8 @@ typedef struct {
35
35
  char *name;
36
36
  /** The JDK or JRE installation path (JAVA_HOME). */
37
37
  char *home;
38
+ /** Working directory (defaults to /). */
39
+ char *cwd;
38
40
  /** Options used to invoke the JVM. */
39
41
  char **opts;
40
42
  /** Number of JVM options. */
@@ -14,7 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- /* @version $Id: help.c 1196265 2011-11-01 20:43:52Z mturk $ */
17
+ /* @version $Id: help.c 1430766 2013-01-09 10:23:01Z mturk $ */
18
18
  #include "jsvc.h"
19
19
 
20
20
  void help(home_data *data)
@@ -60,6 +60,8 @@ void help(home_data *data)
60
60
  printf(" user used to run the daemon (defaults to current user)\n");
61
61
  printf(" -verbose[:class|gc|jni]\n");
62
62
  printf(" enable verbose output\n");
63
+ printf(" -cwd </full/path>\n");
64
+ printf(" set working directory to given location (defaults to /)\n");
63
65
  printf(" -outfile </full/path/to/file>\n");
64
66
  printf(" Location for output from stdout (defaults to /dev/null)\n");
65
67
  printf(" Use the value '&2' to simulate '1>&2'\n");
@@ -99,7 +101,7 @@ void help(home_data *data)
99
101
  printf(" -keepstdin\n");
100
102
  printf(" does not redirect stdin to /dev/null\n");
101
103
  printf("\njsvc (Apache Commons Daemon) " JSVC_VERSION_STRING "\n");
102
- printf("Copyright (c) 1999-2011 Apache Software Foundation.\n");
104
+ printf("Copyright (c) 1999-2013 Apache Software Foundation.\n");
103
105
 
104
106
  printf("\n");
105
107
  }
@@ -14,7 +14,7 @@
14
14
  See the License for the specific language governing permissions and
15
15
  limitations under the License.
16
16
  */
17
- /* @version $Id: home.c 1000002 2010-09-22 14:48:37Z mturk $ */
17
+ /* @version $Id: home.c 1416921 2012-12-04 13:09:44Z mturk $ */
18
18
  #include "jsvc.h"
19
19
 
20
20
  /* Check if a path is a directory */
@@ -212,9 +212,13 @@ static home_data *find(char *path)
212
212
  home_data *data = NULL;
213
213
  int x = 0;
214
214
 
215
- if (path == NULL) {
215
+ if (path == NULL || *path == '\0' || strcmp(path, "/") == 0) {
216
216
  log_debug("Home not specified on command line, using environment");
217
217
  path = getenv("JAVA_HOME");
218
+ if (path == NULL || *path == '\0' || strcmp(path, "/") == 0) {
219
+ /* guard against empty JAVA_HOME */
220
+ path = NULL;
221
+ }
218
222
  }
219
223
 
220
224
  if (path == NULL) {
@@ -14,7 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- /* @version $Id: jsvc-unix.c 1293002 2012-02-23 22:48:24Z mturk $ */
17
+ /* @version $Id: jsvc-unix.c 1412037 2012-11-21 10:01:22Z mturk $ */
18
18
  #include "jsvc.h"
19
19
 
20
20
  #include <signal.h>
@@ -247,12 +247,23 @@ static fd_cap_set_flag fp_cap_set_flag;
247
247
  static fd_cap_set_proc fp_cap_set_proc;
248
248
 
249
249
  static const char *libcap_locs[] = {
250
+ #ifdef __LP64__
251
+ "/lib64/libcap.so.2",
252
+ "/lib64/libcap.so.1",
253
+ "/lib64/libcap.so",
254
+ "/usr/lib64/libcap.so.2",
255
+ "/usr/lib64/libcap.so.1",
256
+ "/usr/lib64/libcap.so",
257
+ #endif
250
258
  "/lib/libcap.so.2",
251
259
  "/lib/libcap.so.1",
252
260
  "/lib/libcap.so",
253
261
  "/usr/lib/libcap.so.2",
254
262
  "/usr/lib/libcap.so.1",
255
263
  "/usr/lib/libcap.so",
264
+ "libcap.so.2",
265
+ "libcap.so.1",
266
+ "libcap.so",
256
267
  NULL
257
268
  };
258
269
 
@@ -487,6 +498,56 @@ static sighandler_t signal_set(int sig, sighandler_t newHandler)
487
498
  return hand;
488
499
  }
489
500
 
501
+ static int mkdir0(const char *name, int perms)
502
+ {
503
+ if (mkdir(name, perms) == 0)
504
+ return 0;
505
+ else
506
+ return errno;
507
+ }
508
+
509
+ static int mkdir1(char *name, int perms)
510
+ {
511
+ int rc;
512
+
513
+ rc = mkdir0(name, perms);
514
+ if (rc == EEXIST)
515
+ return 0;
516
+ if (rc == ENOENT) { /* Missing an intermediate dir */
517
+ char *pos;
518
+ if ((pos = strrchr(name, '/'))) {
519
+ *pos = '\0';
520
+ if (*name) {
521
+ if (!(rc = mkdir1(name, perms))) {
522
+ /* Try again, now with parents created
523
+ */
524
+ *pos = '/';
525
+ rc = mkdir0(name, perms);
526
+ }
527
+ }
528
+ *pos = '/';
529
+ }
530
+ }
531
+ return rc;
532
+ }
533
+
534
+ static int mkdir2(const char *name, int perms)
535
+ {
536
+ int rc = 0;
537
+ char *pos;
538
+ char *dir = strdup(name);
539
+
540
+ if (!dir)
541
+ return ENOMEM;
542
+ if ((pos = strrchr(dir, '/'))) {
543
+ *pos = '\0';
544
+ if (*dir)
545
+ rc = mkdir1(dir, perms);
546
+ }
547
+ free(dir);
548
+ return rc;
549
+ }
550
+
490
551
  /*
491
552
  * Check pid and if still running
492
553
  */
@@ -498,9 +559,16 @@ static int check_pid(arg_data *args)
498
559
  char buff[80];
499
560
  pid_t pidn = getpid();
500
561
  int i, pid;
562
+ int once = 0;
501
563
 
502
- fd = open(args->pidf, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR);
564
+ retry:
565
+ fd = open(args->pidf, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
503
566
  if (fd < 0) {
567
+ if (once == 0 && (errno == ENOTDIR || errno == ENOENT)) {
568
+ once = 1;
569
+ if (mkdir2(args->pidf, S_IRWXU | S_IXGRP | S_IRGRP | S_IXOTH | S_IROTH) == 0)
570
+ goto retry;
571
+ }
504
572
  log_error("Cannot open PID file %s, PID is %d", args->pidf, pidn);
505
573
  return -1;
506
574
  }
@@ -847,6 +915,7 @@ static FILE *loc_freopen(char *outfile, char *mode, FILE * stream)
847
915
  {
848
916
  FILE *ftest;
849
917
 
918
+ mkdir2(outfile, S_IRWXU);
850
919
  ftest = fopen(outfile, mode);
851
920
  if (ftest == NULL) {
852
921
  fprintf(stderr, "Unable to redirect to %s\n", outfile);
@@ -1154,6 +1223,10 @@ int main(int argc, char *argv[])
1154
1223
  #endif
1155
1224
  }
1156
1225
 
1226
+ if (chdir(args->cwd)) {
1227
+ log_error("ERROR: jsvc was unable to "
1228
+ "change directory to: %s", args->cwd);
1229
+ }
1157
1230
  /*
1158
1231
  * umask() uses inverse logic; bits are CLEAR for allowed access.
1159
1232
  */
@@ -14,7 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- /* @version $Id: location.c 1199195 2011-11-08 11:30:20Z mturk $ */
17
+ /* @version $Id: location.c 1419313 2012-12-10 10:05:19Z mturk $ */
18
18
  #include "jsvc.h"
19
19
 
20
20
  /* Locations of various JVM files. We have to deal with all this madness since
@@ -33,10 +33,20 @@ char *location_home[] = {
33
33
  "/System/Library/Frameworks/JavaVM.framework/Home",
34
34
  "/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home/",
35
35
  #elif defined(OS_LINUX) || defined(OS_SOLARIS) || defined(OS_BSD)
36
+ "/usr/java/default",
36
37
  "/usr/java",
37
38
  "/usr/local/java",
39
+ "/usr/lib/jvm/default-java",
40
+ "/usr/lib/jvm/java",
38
41
  "/etc/alternatives/java_sdk",
42
+ "/etc/alternatives/java_sdk_openjdk",
39
43
  "/etc/alternatives/jre",
44
+ #if defined(__LP64__)
45
+ "/lib64/jvm/java",
46
+ "/lib64/jvm/java-openjdk",
47
+ #endif
48
+ "/lib/jvm/java",
49
+ "/lib/jvm/java-openjdk",
40
50
  #elif defined(OS_CYGWIN)
41
51
  "/cygdrive/c/WINNT/system32/java",
42
52
  #elif defined(OS_SYSV)
@@ -31,7 +31,7 @@
31
31
  #define JSVC_MINOR_VERSION 0
32
32
 
33
33
  /** patch level */
34
- #define JSVC_PATCH_VERSION 10
34
+ #define JSVC_PATCH_VERSION 13
35
35
 
36
36
  /**
37
37
  * This symbol is defined for internal, "development" copies of JSVC.
@@ -16,7 +16,7 @@
16
16
  # limitations under the License.
17
17
 
18
18
  # @author Pier Fumagalli <mailto:pier.fumagalli@eng.sun.com>
19
- # @version $Id: buildconf.sh 480475 2006-11-29 08:31:47Z bayard $
19
+ # @version $Id: buildconf.sh 1433971 2013-01-16 15:08:47Z sebb $
20
20
 
21
21
  # The cache of automake always brings problems when changing *.m4 files.
22
22
  rm -rf autom4te.cache
File without changes
@@ -1,5 +1,5 @@
1
1
  module Trinidad
2
2
  module InitServices
3
- VERSION = '1.2.2'
3
+ VERSION = '1.2.3'
4
4
  end
5
5
  end
Binary file
Binary file
Binary file
Binary file
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: trinidad_init_services
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.2.2
5
+ version: 1.2.3
6
6
  platform: ruby
7
7
  authors:
8
8
  - David Calavera
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2012-10-23 00:00:00 Z
13
+ date: 2013-09-10 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: trinidad