• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
User Management
#1
I want to set up a new user role called "Operator".
The Operator should only be able to change time settings (TZ and NTP Server) and to adjust network LAN settings.

So far everything works fine.

The operator should have the ability to reboot or shutdown the gateway. The problem I have, I can't find any appropriate setting.

Which "resource" in the role definition is needed therefor?

Netpi has firmware version 1.2.0.0.

Thanks for any reply.
Hermann
  Reply
#2
Well ... when it came to the netPI product 4 years ago we made the decision that some system relevant options like software update, package installation, reboot and shutdown are only available to the admin account.

They all have massive influence on a running system if used and could lead to plant downtimes. This is why those important features are only available to the admin account only. They cannot be enabled to other users.

Thx
Armin
You never fail until you stop trying.“, Albert Einstein (1879 - 1955)

  Reply
#3
Let me explain what my intention for this question is. Maybe you have another solution for my problem.

We want to supply our customer with a certain functionality which was realized with the gateway and a certain number of containers on it.
The customer needs to adjust some settings like time zone, network and so one. Otherwise he can't operate the device at his plant.
He shouldn't be able e.g. to switch of the Docker service, but he should be able to shutdown the gateway in a save way. (Or is that not necessary?)

How can I manage these challenge?

There is mentioned a Edge Server / REST API.
Can i use this for shutdown the Gateway from my application?

Thanks for any ideas.

Hermann

P.S.: I know this extends the topic of the thread. Should I start a new one?
  Reply
#4
Well usually a container can't shutdown a system at all. But there are two methods I see.

1. A hard way is to shutdown using this command in a container

Code:
echo 1 >/proc/sys/kernel/sysrq && echo s > /proc/sysrq-trigger && sleep 10 && echo b > /proc/sysrq-trigger

2. A more smoothen way is to access the netPI web UI over its REST API. I described it here https://forum.hilscher.com/thread-317.ht...hlight=API a while ago with some sample codings. So basically all the manual mouse triggered function you do usually in your web browser you can do also automated like login, watch pages, trigger functions.

For a test with Linux install http command first with

Code:
apt-get install httpie

Then login to your netPI using your admin password instead of <your admin password> and note down the <session-ID> received back in the response

Code:
http --verify=no --json POST "https://<netPI IP address>/login" username=admin password=<your admin password>

Then call the shutdown command and wait for 10 seconds and the shutdown will start to proceed.

Code:
http --verify=no --json POST "https://<netPI IP address>/system" 'Cookie:<session-ID>' 'argument=shutdown'


Thx
Armin
You never fail until you stop trying.“, Albert Einstein (1879 - 1955)

  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Edge Gateway Manager - Docker Management HagnSchool 1 2,099 June-8th-2018, 07:50 AM
Last Post: Armin@netPI

Forum Jump:


Users browsing this thread: 1 Guest(s)