diff --git a/debian/neofs-ir.postinst b/debian/neofs-ir.postinst index 76c2f7c3fd..f8ad5ea9cb 100644 --- a/debian/neofs-ir.postinst +++ b/debian/neofs-ir.postinst @@ -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 diff --git a/debian/neofs-storage.dirs b/debian/neofs-storage.dirs index 8a686a9862..39bc449bc0 100644 --- a/debian/neofs-storage.dirs +++ b/debian/neofs-storage.dirs @@ -1,2 +1,3 @@ /etc/neofs/storage /srv/neofs +/var/lib/neofs/storage diff --git a/debian/neofs-storage.postinst b/debian/neofs-storage.postinst index a8257e93eb..a0a2de9652 100644 --- a/debian/neofs-storage.postinst +++ b/debian/neofs-storage.postinst @@ -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) diff --git a/debian/neofs-storage.postrm b/debian/neofs-storage.postrm index 244ca7483b..e5a432858e 100644 --- a/debian/neofs-storage.postrm +++ b/debian/neofs-storage.postrm @@ -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)