diff options
author | PradeepKiruvale <pradeepkumar.kj@softwareag.com> | 2022-04-21 15:03:09 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-21 15:03:09 +0530 |
commit | 001347fd92e0b697a01a591ae68b3316be0d9ec1 (patch) | |
tree | 9d3555a8588d9e2cd8640658374812dd359fa0a7 /configuration/debian/tedge_agent/postinst | |
parent | 7033ab55c70611bec47f2aee79e38de7e88e6d58 (diff) |
Have a single unix user used for all the thin-edge daemons (#1085)
* Closes #1031 single tedge user
Signed-off-by: Pradeep Kumar K J <pradeepkumar.kj@softwareag.com>
* Add script to upgrade tedge from 0.6
Signed-off-by: Pradeep Kumar K J <pradeepkumar.kj@softwareag.com>
Diffstat (limited to 'configuration/debian/tedge_agent/postinst')
-rw-r--r-- | configuration/debian/tedge_agent/postinst | 22 |
1 files changed, 1 insertions, 21 deletions
diff --git a/configuration/debian/tedge_agent/postinst b/configuration/debian/tedge_agent/postinst index 7430e3dc..4059b182 100644 --- a/configuration/debian/tedge_agent/postinst +++ b/configuration/debian/tedge_agent/postinst @@ -2,26 +2,6 @@ set -e -### Create a group "tedge-agent" if not created before -if ! getent group tedge-agent >/dev/null; then - addgroup --quiet --system tedge-agent -fi - -### Create a user "tedge-agent" if not created before -# Create user tedge-agent with no home(--no-create-home), no login(--shell) and in group tedge-agent(--ingroup) -if ! getent passwd tedge-agent >/dev/null; then - adduser --quiet --system --no-create-home --ingroup tedge-agent --shell /usr/sbin/nologin tedge-agent - adduser tedge-agent tedge -fi - -### Create file in /etc/sudoers.d directory -# tedge-agent needs to execute some of its operations as a system user therefore it needs an entry in /etc/sudoers. -echo "%tedge-agent ALL = (ALL) NOPASSWD: /etc/tedge/sm-plugins/[a-zA-Z0-9]*, /bin/sync, /sbin/init" >/etc/sudoers.d/tedge-agent - -if [ -f "/etc/sudoers.d/010_pi-nopasswd" ]; then - echo "%tedge-agent ALL = (ALL) NOPASSWD: /etc/tedge/sm-plugins/[a-zA-Z0-9]*, /bin/sync, /sbin/init" >/etc/sudoers.d/tedge-agent-nopasswd -fi - # Reenable the services only if systemctl is available if command -v systemctl >/dev/null; then ### Enable the sm services if the device is connected to c8y cloud @@ -33,6 +13,6 @@ if command -v systemctl >/dev/null; then fi # Initialize the agent -runuser -u tedge-agent -- tedge_agent --init +runuser -u tedge -- tedge_agent --init #DEBHELPER# |