forked from TrueCloudLab/frostfs-node
[#409] debian: Refactor storage service paths
Separate User data and Service data: - /var/lib/neofs/storage for service persistence - /srv/neofs for user data Signed-off-by: Evgenii Stratonikov <evgeniy@morphbits.ru>
This commit is contained in:
parent
660c38d07e
commit
98e6dc5ce8
4 changed files with 17 additions and 5 deletions
7
debian/neofs-ir.postinst
vendored
7
debian/neofs-ir.postinst
vendored
|
@ -21,9 +21,12 @@ case "$1" in
|
|||
USERNAME=ir
|
||||
id -u neofs-ir >/dev/null 2>&1 || useradd -s /usr/sbin/nologin -d /var/lib/neofs/ir --system -M -U -c "NeoFS InnerRing node" neofs-ir
|
||||
if ! dpkg-statoverride --list /etc/neofs/$USERNAME >/dev/null; then
|
||||
chown -f root:neofs-$USERNAME /etc/neofs/$USERNAME/*
|
||||
chown -f root:neofs-$USERNAME /etc/neofs/$USERNAME
|
||||
chmod -f 0750 /etc/neofs/$USERNAME
|
||||
|
||||
chown -f root:neofs-$USERNAME /etc/neofs/$USERNAME/config.yml
|
||||
chown -f root:neofs-$USERNAME /etc/neofs/$USERNAME/control.yml
|
||||
chmod -f 0640 /etc/neofs/$USERNAME/config.yml || true
|
||||
chmod -f 0640 /etc/neofs/$USERNAME/control.yml || true
|
||||
fi
|
||||
USERDIR=$(getent passwd "neofs-$USERNAME" | cut -d: -f6)
|
||||
if ! dpkg-statoverride --list neofs-$USERDIR >/dev/null; then
|
||||
|
|
1
debian/neofs-storage.dirs
vendored
1
debian/neofs-storage.dirs
vendored
|
@ -1,2 +1,3 @@
|
|||
/etc/neofs/storage
|
||||
/srv/neofs
|
||||
/var/lib/neofs/storage
|
||||
|
|
12
debian/neofs-storage.postinst
vendored
12
debian/neofs-storage.postinst
vendored
|
@ -19,15 +19,23 @@ set -e
|
|||
case "$1" in
|
||||
configure)
|
||||
USERNAME=storage
|
||||
id -u neofs-storage >/dev/null 2>&1 || useradd -s /usr/sbin/nologin -d /srv/neofs --system -M -U -c "NeoFS Storage node" neofs-storage
|
||||
id -u neofs-$USERNAME >/dev/null 2>&1 || useradd -s /usr/sbin/nologin -d /var/lib/neofs/$USERNAME --system -M -U -c "NeoFS Storage node" neofs-$USERNAME
|
||||
if ! dpkg-statoverride --list /etc/neofs/$USERNAME >/dev/null; then
|
||||
chown -f root:neofs-$USERNAME /etc/neofs/$USERNAME/*
|
||||
chown -f root:neofs-$USERNAME /etc/neofs/$USERNAME
|
||||
chmod -f 0750 /etc/neofs/$USERNAME
|
||||
chown -f root:neofs-$USERNAME /etc/neofs/$USERNAME/config.yml
|
||||
chown -f root:neofs-$USERNAME /etc/neofs/$USERNAME/control.yml
|
||||
chmod -f 0640 /etc/neofs/$USERNAME/config.yml || true
|
||||
chmod -f 0640 /etc/neofs/$USERNAME/control.yml || true
|
||||
fi
|
||||
USERDIR=$(getent passwd "neofs-$USERNAME" | cut -d: -f6)
|
||||
if ! dpkg-statoverride --list neofs-$USERDIR >/dev/null; then
|
||||
chown -f neofs-$USERNAME: $USERDIR
|
||||
fi
|
||||
USERDIR=/srv/neofs
|
||||
if ! dpkg-statoverride --list neofs-$USERDIR >/dev/null; then
|
||||
chown -f neofs-$USERNAME: $USERDIR
|
||||
fi
|
||||
;;
|
||||
|
||||
abort-upgrade|abort-remove|abort-deconfigure)
|
||||
|
|
2
debian/neofs-storage.postrm
vendored
2
debian/neofs-storage.postrm
vendored
|
@ -20,7 +20,7 @@ set -e
|
|||
|
||||
case "$1" in
|
||||
purge)
|
||||
rm -rf /srv/neofs/*
|
||||
rm -rf /var/lib/neofs/storage/*
|
||||
;;
|
||||
|
||||
remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
|
||||
|
|
Loading…
Reference in a new issue