summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKrzysztof Piotrowski <krzysztof.piotrowski@inetum.com>2022-08-19 17:20:23 +0200
committerKrzysztof Piotrowski <krzysztof.piotrowski@inetum.com>2022-08-22 16:17:12 +0200
commit1c627374f60b202dd766067404f948f1b936a2e6 (patch)
treeb099f1152f5a82dbb335ac306ecfa0e8c976fc65
parent53c75cb81ec4551fde6dab3e26ef55ff6cd7e7f2 (diff)
Replace scripts commands for the cross-Unix system compatibility
Signed-off-by: Krzysztof Piotrowski <krzysztof.piotrowski@inetum.com>
-rw-r--r--configuration/debian/tedge/preinst6
-rw-r--r--configuration/debian/tedge_agent/postinst2
-rw-r--r--configuration/debian/tedge_mapper/postinst4
3 files changed, 6 insertions, 6 deletions
diff --git a/configuration/debian/tedge/preinst b/configuration/debian/tedge/preinst
index b2843104..ec91f6e8 100644
--- a/configuration/debian/tedge/preinst
+++ b/configuration/debian/tedge/preinst
@@ -3,13 +3,13 @@ set -e
### Create groups
if ! getent group tedge >/dev/null; then
- addgroup --quiet --system tedge
+ groupadd --system tedge
fi
### Create users
-# Create user tedge with no additional info(--gecos "") no home(--no-create-home), no login(--shell) and in group tedge(--ingroup)
+# Create user tedge with no home(--no-create-home), no login(--shell) and in group tedge(--gid)
if ! getent passwd tedge >/dev/null; then
- adduser --quiet --system --gecos "" --no-create-home --disabled-login --shell /sbin/nologin --ingroup tedge tedge
+ useradd --system --no-create-home --shell /sbin/nologin --gid tedge tedge
fi
### Create file in /etc/sudoers.d directory. With this configuration, the tedge user have the right to call the tedge command with sudo rights, which is required for system-wide configuration in "/etc/tedge"
diff --git a/configuration/debian/tedge_agent/postinst b/configuration/debian/tedge_agent/postinst
index 4059b182..348ebe12 100644
--- a/configuration/debian/tedge_agent/postinst
+++ b/configuration/debian/tedge_agent/postinst
@@ -13,6 +13,6 @@ if command -v systemctl >/dev/null; then
fi
# Initialize the agent
-runuser -u tedge -- tedge_agent --init
+sudo -u tedge -- tedge_agent --init
#DEBHELPER#
diff --git a/configuration/debian/tedge_mapper/postinst b/configuration/debian/tedge_mapper/postinst
index bb12342a..a637165f 100644
--- a/configuration/debian/tedge_mapper/postinst
+++ b/configuration/debian/tedge_mapper/postinst
@@ -4,6 +4,6 @@ set -e
### Initialize the sm mapper
-runuser -u tedge -- tedge_mapper --init c8y
-runuser -u tedge -- tedge_mapper --init az
+sudo -u tedge -- tedge_mapper --init c8y
+sudo -u tedge -- tedge_mapper --init az
#DEBHELPER#