memgraph/release/arch-pkg/memgraph.install
Teon Banek 456e95d12c Add building ArchLinux package of Memgraph
Reviewers: mferencevic, buda

Reviewed By: mferencevic

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1101
2018-01-11 14:25:25 +01:00

23 lines
751 B
Plaintext

post_install() {
# Add the 'memgraph' user and group and set permissions on
# 'var/*/memgraph' directories.
useradd --system memgraph
res=$?
if [[ "$res" != "0" && "$res" != "9" ]]; then
exit 1
fi
chown memgraph:memgraph /var/lib/memgraph || exit 1
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
echo "Enable and start 'memgraph.service' to use Memgraph" || exit 1
}
pre_remove() {
# Remove optional immutability from examples directory to allow removal
chattr -i -R /usr/share/memgraph/examples || true
systemctl disable memgraph.service
}