Skip to content
This repository was archived by the owner on Oct 8, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions appassembler-maven-plugin/src/main/patches/sh.script.in
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,13 @@ then
fi
fi

# If $PIDDIR is in a tmpfs (typically /var/run) the PIDDIR it is likely to not exists.
# Make sure the folder exists
if [ ! -d "$PIDDIR" ]; then
_PIDIR_CREATED=1
mkdir "$PIDDIR"
fi

checkUser() {
# $1 touchLock flag
# $2 command
Expand Down Expand Up @@ -343,6 +350,18 @@ checkUser() {
chown $RUN_AS_USER:$RUN_AS_GROUP $LOCKFILE
fi
fi
# If $RUN_AS_USER is defined and PIDDIR was created, the new user it will not be
# able to create the pid file. Make sure new user has permission over PIDDIR.
if [ "X$_PIDIR_CREATED" != "X" ]
then
# Resolve the primary group
RUN_AS_GROUP=`groups $RUN_AS_USER | awk '{print $3}' | tail -1`
if [ "X$RUN_AS_GROUP" = "X" ]
then
RUN_AS_GROUP=$RUN_AS_USER
fi
chown $RUN_AS_USER:$RUN_AS_GROUP "$PIDDIR"
fi

# Still want to change users, recurse. This means that the user will only be
# prompted for a password once. Variables shifted by 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,13 @@ then
fi
fi

# If $PIDDIR is in a tmpfs (typically /var/run) the PIDDIR it is likely to not exists.
# Make sure the folder exists
if [ ! -d "$PIDDIR" ]; then
_PIDIR_CREATED=1
mkdir "$PIDDIR"
fi

checkUser() {
# $1 touchLock flag
# $2 command
Expand Down Expand Up @@ -343,6 +350,18 @@ checkUser() {
chown $RUN_AS_USER:$RUN_AS_GROUP $LOCKFILE
fi
fi
# If $RUN_AS_USER is defined and PIDDIR was created, the new user it will not be
# able to create the pid file. Make sure new user has permission over PIDDIR.
if [ "X$_PIDIR_CREATED" != "X" ]
then
# Resolve the primary group
RUN_AS_GROUP=`groups $RUN_AS_USER | awk '{print $3}' | tail -1`
if [ "X$RUN_AS_GROUP" = "X" ]
then
RUN_AS_GROUP=$RUN_AS_USER
fi
chown $RUN_AS_USER:$RUN_AS_GROUP "$PIDDIR"
fi

# Still want to change users, recurse. This means that the user will only be
# prompted for a password once. Variables shifted by 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,13 @@ then
fi
fi

# If $PIDDIR is in a tmpfs (typically /var/run) the PIDDIR it is likely to not exists.
# Make sure the folder exists
if [ ! -d "$PIDDIR" ]; then
_PIDIR_CREATED=1
mkdir "$PIDDIR"
fi

checkUser() {
# $1 touchLock flag
# $2 command
Expand Down Expand Up @@ -343,6 +350,18 @@ checkUser() {
chown $RUN_AS_USER:$RUN_AS_GROUP $LOCKFILE
fi
fi
# If $RUN_AS_USER is defined and PIDDIR was created, the new user it will not be
# able to create the pid file. Make sure new user has permission over PIDDIR.
if [ "X$_PIDIR_CREATED" != "X" ]
then
# Resolve the primary group
RUN_AS_GROUP=`groups $RUN_AS_USER | awk '{print $3}' | tail -1`
if [ "X$RUN_AS_GROUP" = "X" ]
then
RUN_AS_GROUP=$RUN_AS_USER
fi
chown $RUN_AS_USER:$RUN_AS_GROUP "$PIDDIR"
fi

# Still want to change users, recurse. This means that the user will only be
# prompted for a password once. Variables shifted by 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,13 @@ then
fi
fi

# If $PIDDIR is in a tmpfs (typically /var/run) the PIDDIR it is likely to not exists.
# Make sure the folder exists
if [ ! -d "$PIDDIR" ]; then
_PIDIR_CREATED=1
mkdir "$PIDDIR"
fi

checkUser() {
# $1 touchLock flag
# $2 command
Expand Down Expand Up @@ -343,6 +350,18 @@ checkUser() {
chown $RUN_AS_USER:$RUN_AS_GROUP $LOCKFILE
fi
fi
# If $RUN_AS_USER is defined and PIDDIR was created, the new user it will not be
# able to create the pid file. Make sure new user has permission over PIDDIR.
if [ "X$_PIDIR_CREATED" != "X" ]
then
# Resolve the primary group
RUN_AS_GROUP=`groups $RUN_AS_USER | awk '{print $3}' | tail -1`
if [ "X$RUN_AS_GROUP" = "X" ]
then
RUN_AS_GROUP=$RUN_AS_USER
fi
chown $RUN_AS_USER:$RUN_AS_GROUP "$PIDDIR"
fi

# Still want to change users, recurse. This means that the user will only be
# prompted for a password once. Variables shifted by 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,13 @@ then
fi
fi

# If $PIDDIR is in a tmpfs (typically /var/run) the PIDDIR it is likely to not exists.
# Make sure the folder exists
if [ ! -d "$PIDDIR" ]; then
_PIDIR_CREATED=1
mkdir "$PIDDIR"
fi

checkUser() {
# $1 touchLock flag
# $2 command
Expand Down Expand Up @@ -343,6 +350,18 @@ checkUser() {
chown $RUN_AS_USER:$RUN_AS_GROUP $LOCKFILE
fi
fi
# If $RUN_AS_USER is defined and PIDDIR was created, the new user it will not be
# able to create the pid file. Make sure new user has permission over PIDDIR.
if [ "X$_PIDIR_CREATED" != "X" ]
then
# Resolve the primary group
RUN_AS_GROUP=`groups $RUN_AS_USER | awk '{print $3}' | tail -1`
if [ "X$RUN_AS_GROUP" = "X" ]
then
RUN_AS_GROUP=$RUN_AS_USER
fi
chown $RUN_AS_USER:$RUN_AS_GROUP "$PIDDIR"
fi

# Still want to change users, recurse. This means that the user will only be
# prompted for a password once. Variables shifted by 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,13 @@ then
fi
fi

# If $PIDDIR is in a tmpfs (typically /var/run) the PIDDIR it is likely to not exists.
# Make sure the folder exists
if [ ! -d "$PIDDIR" ]; then
_PIDIR_CREATED=1
mkdir "$PIDDIR"
fi

checkUser() {
# $1 touchLock flag
# $2 command
Expand Down Expand Up @@ -343,6 +350,18 @@ checkUser() {
chown $RUN_AS_USER:$RUN_AS_GROUP $LOCKFILE
fi
fi
# If $RUN_AS_USER is defined and PIDDIR was created, the new user it will not be
# able to create the pid file. Make sure new user has permission over PIDDIR.
if [ "X$_PIDIR_CREATED" != "X" ]
then
# Resolve the primary group
RUN_AS_GROUP=`groups $RUN_AS_USER | awk '{print $3}' | tail -1`
if [ "X$RUN_AS_GROUP" = "X" ]
then
RUN_AS_GROUP=$RUN_AS_USER
fi
chown $RUN_AS_USER:$RUN_AS_GROUP "$PIDDIR"
fi

# Still want to change users, recurse. This means that the user will only be
# prompted for a password once. Variables shifted by 1
Expand Down