Skip to content
This repository has been archived by the owner on Nov 20, 2019. It is now read-only.

Commit

Permalink
Fixed postinstall script file permission updates (#554)
Browse files Browse the repository at this point in the history
  • Loading branch information
pfcoperez committed May 26, 2016
1 parent 6a9a3b7 commit 7a5be31
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 15 deletions.
27 changes: 20 additions & 7 deletions dist/src/main/unix/scripts/post
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ DIR_CONF='/etc/sds/crossdata'
DIR_LOG='/var/log/sds/crossdata'
DIR_CHECKPOINT='/var/sds/crossdata'


# Add stratio group if it doesn't already exists
if ! getent group $GROUP >/dev/null 2>&1; then
groupadd ${GROUP}
Expand All @@ -32,22 +33,34 @@ if [ ! -d "$DIR_LOG" ]; then
mkdir $DIR_CHECKPOINT
fi


# change ownership of the parents directories
chown root:stratio /etc/sds
chown root:stratio /opt/sds
chown root:stratio /var/log/sds
chown root:stratio /var/run/sds
chown root:stratio /var/sds
chmod 775 /etc/sds
chmod 775 /opt/sds
chmod 775 /var/log/sds
chmod 775 /var/sds
chmod 775 /var/run/sds

chown root:root /etc/init.d/crossdata

chown -R ${USER}:${GROUP} $DIR_INSTALL

chown -R ${USER}:${GROUP} $DIR_CONF
chown -R ${USER}:${GROUP} $DIR_LOG
chown -R ${USER}:${GROUP} $DIR_CHECKPOINT
chown -R ${USER}:${GROUP} /var/run/sds

chmod -R 775 $DIR_INSTALL
chmod 775 $DIR_LOG
chmod 775 $DIR_CHECKPOINT
chmod -R 755 $DIR_INSTALL
chmod 755 $DIR_LOG
chmod 755 $DIR_CHECKPOINT

chmod 775 $DIR_CONF
chmod 775 $DIR_CONF/shell
chmod 775 $DIR_CONF/server
chmod 755 $DIR_CONF
chmod 755 $DIR_CONF/shell
chmod 755 $DIR_CONF/server

chmod 640 $DIR_CONF/shell/*
chmod 640 $DIR_CONF/server/*
Expand Down
27 changes: 19 additions & 8 deletions dist/src/main/unix/scripts/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -40,23 +40,34 @@ case "$1" in
fi


# change ownership of the parents directories
chown root:stratio /etc/sds
chown root:stratio /opt/sds
chown root:stratio /var/log/sds
chown root:stratio /var/run/sds
chown root:stratio /var/sds
chmod 775 /etc/sds
chmod 775 /opt/sds
chmod 775 /var/log/sds
chmod 775 /var/sds
chmod 775 /var/run/sds

chown root:root /etc/init.d/crossdata

chown -R ${USER}:${GROUP} $DIR_INSTALL
chown -R ${USER}:${GROUP} $DIR_CONF
chown -R ${USER}:${GROUP} $DIR_LOG
chown -R ${USER}:${GROUP} $DIR_CHECKPOINT
chown -R ${USER}:${GROUP} /var/run/sds

chmod -R 775 $DIR_INSTALL
chmod 775 $DIR_LOG
chmod -R 755 $DIR_INSTALL
chmod 755 $DIR_LOG
chmod 755 /etc/init.d/crossdata
chmod 755 /opt/sds/crossdata/bin/*

chmod 775 $DIR_CHECKPOINT
chmod 775 $DIR_CONF
chmod 775 $DIR_CONF/shell
chmod 775 $DIR_CONF/server
chmod 755 $DIR_CHECKPOINT
chmod 755 $DIR_CONF
chmod 755 $DIR_CONF/shell
chmod 755 $DIR_CONF/server

chmod 640 $DIR_CONF/shell/*
chmod 640 $DIR_CONF/server/*
Expand All @@ -72,4 +83,4 @@ case "$1" in
esac


exit 0
exit 0

0 comments on commit 7a5be31

Please sign in to comment.