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

Commit

Permalink
fix deb generation
Browse files Browse the repository at this point in the history
  • Loading branch information
darroyo-stratio committed Aug 31, 2015
1 parent a0ca6d9 commit 776d0f8
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 4 deletions.
12 changes: 8 additions & 4 deletions cassandra-connector/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -224,14 +224,18 @@
<dir>/usr</dir>
<dir>/bin</dir>
</excludeDirectoryAttributes>

<!-- Default values for files and directories. -->
<defaults>
<directoryAttributes>
<mode>0755</mode>
<user>stratio</user>
<group>stratio</group>
<mode>0775</mode>
</directoryAttributes>
<fileAttributes>
<mode>0644</mode>
<user>stratio</user>
<group>stratio</group>
<mode>0664</mode>
</fileAttributes>
</defaults>

Expand All @@ -246,7 +250,7 @@
<attributes>
<user>stratio</user>
<group>stratio</group>
<mode>644</mode>
<mode>775</mode>
</attributes>
</mkdirs>
<copyDirectory>
Expand Down
23 changes: 23 additions & 0 deletions cassandra-connector/src/main/unix/scripts/pre
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/sh

#RPM

set -e

GROUP='stratio'
USER='stratio'

# Add stratio group if it doesn't already exists
if ! getent group $GROUP >/dev/null 2>&1; then
groupadd ${GROUP}
fi

# Add stratio user if it doesn't already exists
if ! getent passwd $USER >/dev/null 2>&1; then
[ -d /opt ] || mkdir /opt
useradd -M -d /opt/sds -g ${GROUP} -s /bin/bash ${USER}
else
usermod -G $GROUP $USER
fi

exit 0
29 changes: 29 additions & 0 deletions cassandra-connector/src/main/unix/scripts/preinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/sh

set -e

#DEB

GROUP='stratio'
USER='stratio'

case "$1" in
configure)

# Add stratio group if it doesn't already exists
if ! getent group $GROUP >/dev/null 2>&1; then
groupadd ${GROUP}
fi

# Add stratio user if it doesn't already exists
if ! getent passwd $USER >/dev/null 2>&1; then
[ -d /opt ] || mkdir /opt
useradd -M -d /opt/sds -g ${GROUP} -s /bin/bash ${USER}
else
usermod -G $GROUP $USER
fi

esac


exit 0

0 comments on commit 776d0f8

Please sign in to comment.