https://issues.apache.org/bugzilla/show_bug.cgi?id=47880

           Summary: Lack of +x permissions on script files results cryptic
                    and confusing error messages
           Product: Tomcat 6
           Version: 6.0.20
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Native:Packaging
        AssignedTo: dev@tomcat.apache.org
        ReportedBy: mike.pukuotu...@meska.info


After the user downloads and extracts the .zip archive containing Tomcat
executables, the "executable" flag on the .sh files is not set by default. This
results unexpected and very cryptic error messages about the missing files
(just because catalina.sh is not executable) and later about the incorrect
pathes (just because setclasspath.sh is not executable). This is observed when
the tries to executes startup.sh with sh command.

The problem is not obvious because the files with these improper permissions
are not executed by the user from the command line. Instead, they are executed
calling them from another scripts. The failure to execute setclasspath.sh is
especially confusing as causes only warnings bout some problems with pathes.

I suggest the following change in startup.sh that would make the permission
problem obvious:

# Check that target executable exists
if $os400; then
  # -x will Only work on the os400 if the files are: 
  # 1. owned by the user
  # 2. owned by the PRIMARY group of the user
  # this will not work if the user belongs in secondary groups
  eval
else
  if [ ! -e "$PRGDIR"/"$EXECUTABLE" ]; then
    echo "Cannot find $PRGDIR/$EXECUTABLE"
    echo "This file is needed to run this program"
    exit 1
  fi
  if [ ! -x "$PRGDIR"/"$EXECUTABLE" ]; then
    echo "The $PRGDIR/$EXECUTABLE is not executable"
    echo ".sh files must have the executable flag set"
    exit 1
  fi
fi 

Steps to reproduce:

1. Use the recent Tomcat distribution, apache-tomcat-6.0.20.zip. Do not use
tar.gz as it may preserve the correct permissions.
2. Extract into any empty directory and try to run startup.sh. You will get the
message about catalina.sh missing that is not correct. After you set +x for
catalina.sh you will get more messages that are never about permissions,
leading analysis in confusing directions.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to