mirror of
https://github.com/status-im/nimbus-eth2.git
synced 2025-02-07 20:28:03 +00:00
Otherwise installation in Docker containers fails with: ``` ... Adding new user `nimbus' (UID 101) with group `nimbus' ... Not creating home directory `/home/nimbus'. /var/lib/dpkg/info/nimbus-beacon-node.postinst: 39: systemctl: not found dpkg: error processing package nimbus-beacon-node (--configure): installed nimbus-beacon-node package post-installation script subprocess returned error exit status 127 Errors were encountered while processing: nimbus-beacon-node E: Sub-process /usr/bin/dpkg returned an error code (1) ``` Signed-off-by: Jakub Sokołowski <jakub@status.im>
24 lines
559 B
Bash
24 lines
559 B
Bash
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
DISTRO=$(lsb_release -si)
|
|
if ! id -u nimbus > /dev/null 2>&1; then
|
|
case $DISTRO in
|
|
Ubuntu|Debian)
|
|
# Debian uses `adduser` to create user...
|
|
adduser --system --no-create-home --group nimbus
|
|
;;
|
|
*)
|
|
# ... while `useradd` is more standard
|
|
useradd --system --no-create-home --user-group nimbus
|
|
;;
|
|
esac
|
|
fi
|
|
|
|
mkdir -p /var/lib/nimbus
|
|
chown nimbus:nimbus /var/lib/nimbus
|
|
|
|
# Systems like docker containers do not have systemd.
|
|
systemctl daemon-reload || echo "notice: systemd daemon not reloaded" >&2
|