Create telemetry data directory in packaged examples

Reviewers: buda

Reviewed By: buda

Differential Revision: https://phabricator.memgraph.io/D1447
This commit is contained in:
Matej Ferencevic 2018-06-22 15:42:47 +02:00
parent a82419f824
commit 47e40ffe03
2 changed files with 21 additions and 2 deletions

View File

@ -27,8 +27,17 @@ case "$1" in
chmod 750 /var/lib/memgraph || exit 1
chown memgraph:adm /var/log/memgraph || exit 1
chmod 750 /var/log/memgraph || exit 1
# Make examples directory immutable (optional)
chattr +i -R /usr/share/memgraph/examples || true
# Create telemetry directory in examples
for i in /usr/share/memgraph/examples/*; do
# The telemetry directory may already exist from some prior installation
if [ ! -d $i/telemetry ]; then
mkdir $i/telemetry || exit 1
fi
chown -R memgraph:memgraph $i/telemetry || exit 1
# Make snapshots directory immutable (optional)
chattr +i -R $i/snapshots || true
done
# Generate SSL certificates
if [ ! -d /etc/memgraph/ssl ]; then

View File

@ -26,6 +26,16 @@ case "$1" in
for var_file in $var_files; do
rm -rf $var_file
done
# Remove generated SSL certificates
if [ -d /etc/memgraph/ssl ]; then
rm -rf /etc/memgraph/ssl
fi
# Remove stored telemetry data
for i in /usr/share/memgraph/examples/*; do
if [ -d $i/telemetry ]; then
rm -rf $i/telemetry
fi
done
# Don't remove the 'memgraph' user, since we cannot be sure whether it
# existed before.
;;