How can this be scripted to a button in WinCC? Both Win & Linux Centos gnome
if(_UNIX) ...
else...
Exit WinCC and logout/restart/shutdown PC
- mkoller
- Posts:741
- Joined: Fri Sep 17, 2010 9:03 am
Re: Exit WinCC and logout/restart/shutdown PC
On Linux/Gnome you should be able to logout as follows:
For restart the whole PC (wyh would you need that?):
For shutdown:
Reboot/Shutdown needs the privileges for the user to do so. check "man sudo"
Code: Select all
system("loginctl terminate-session " + getenv("XDG_SESSION_ID"));
Code: Select all
system("sudo /sbin/reboot");
Code: Select all
system("sudo /sbin/halt");