Skip to content

Commit

Permalink
fixup!
Browse files Browse the repository at this point in the history
  • Loading branch information
hoh committed Sep 26, 2023
1 parent 679f865 commit c58dd01
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packaging/aleph-vm/DEBIAN/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ rm -fr /srv/jailer # Upgrade from < 0.1.11
rm -fr /tmp/aleph # Upgrade from < 0.1.11
mkdir -p /var/lib/aleph/vm/jailer

# Create the IPFS directory if it does not exist
if [ ! -d "/var/lib/ipfs" ]; then
mkdir -p /var/lib/ipfs
# Set appropriate permissions if needed
chown ipfs:ipfs /var/lib/ipfs
fi

# Systemd is absent from containers
if ! [[ -v container ]]; then
systemctl daemon-reload
Expand Down
5 changes: 5 additions & 0 deletions packaging/aleph-vm/DEBIAN/postrm
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,9 @@ rm -fr /srv/jailer # Upgrade from < 0.1.11
rm -fr /tmp/aleph/ # Upgrade from < 0.1.11
rm -r /var/lib/aleph/vm/jailer

if [ "$1" = "purge" ]; then
# Remove the directory when the package is purged
rm -rf /var/lib/ipfs
fi

systemctl daemon-reload
3 changes: 3 additions & 0 deletions packaging/aleph-vm/DEBIAN/preinst
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/bin/bash
set -uf -o pipefail

# Documentation: https://www.debian.org/doc/debian-policy/ch-maintainerscripts.html

# Systemd is absent from containers
if ! [[ -v container ]]; then
# Stop the service during an upgrade.
Expand All @@ -10,5 +12,6 @@ fi

set -e

# We will not delete this user on uninstall since there may be files owned by that user in /var/lib/ipfs
addgroup --system ipfs
adduser --system --ingroup ipfs ipfs

0 comments on commit c58dd01

Please sign in to comment.