LoginSignup
0
0

More than 1 year has passed since last update.

Tomcat8.5以上へバージョンアップ

Posted at

1年前ほどに、Tomcatを8.0.Xから9.Xへバージョンアップした。
その際に、困った点を記載しておく。

UMASKのデフォルト設定変更

内容

8.5.XからUMASKの設定値が0027となっている。
そのため、アプリから作成したファイルが他ユーザから見えなくなった。

原因

catalina.shにてUMASK設定をするようになっている。
以下抜粋

# Set UMASK unless it has been overridden
if [ -z "$UMASK" ]; then
    UMASK="0027"
fi
umask $UMASK

# Java 9 no longer supports the java.endorsed.dirs
# system property. Only try to use it if
# JAVA_ENDORSED_DIRS was explicitly set
# or CATALINA_HOME/endorsed exists.
ENDORSED_PROP=ignore.endorsed.dirs
if [ -n "$JAVA_ENDORSED_DIRS" ]; then
    ENDORSED_PROP=java.endorsed.dirs
fi
if [ -d "$CATALINA_HOME/endorsed" ]; then
    ENDORSED_PROP=java.endorsed.dirs
fi

# Make the umask available when using the org.apache.catalina.security.SecurityListener
JAVA_OPTS="$JAVA_OPTS -Dorg.apache.catalina.security.SecurityListener.UMASK=`umask`"

対応

シェルをいると、UMASKが設定されている場合、その値を利用するとあるので、UMASKを設定するとよい。

export  UMASK="0022"
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0