Run WinCCOA as service under Linux

Find and share HowTos to various installations / configurations!
7 posts • Page 1 of 1
Heinrich
Posts:22
Joined: Wed Mar 23, 2011 11:27 am

Run WinCCOA as service under Linux

Post by Heinrich »

Hi,

we have a WinCC OA 3.12 under LINUX Cent OS.

We have problems to run the server as service with a user login ("winccoa").

The server-project runs fine if I start the project with the console (both, as user and root).
Furthermore, the project starts as service with root privileges. But:

if I change the /etc/init.d/winccoa file to

Code: Select all

$Echo "Starting WinCC OA: "$PVSS_II"\\c" 
sudo -u winccoa WCCILpmon &
starts the pmon as user "winccoa" but not the project.

What can be wrong, some ideas?
I Hope that you can help with this problem

Best regards

Uwe Heinrich
Department ELBAS, Section Studies and Development
SIGNON Germany GmbH, Dresden

mkoller
Posts:741
Joined: Fri Sep 17, 2010 9:03 am

Re: Run WinCCOA as service under Linux

Post by mkoller »

I'm doing it like this:
sudo -u winccoa -E WCCILpmon &

-E ... Indicates to the security policy that the user wishes to preserve their existing environment variables.
As you don't use -E, this might be the problem since the init script sets some env vars needed

Heinrich
Posts:22
Joined: Wed Mar 23, 2011 11:27 am

Re: Run WinCCOA as service under Linux

Post by Heinrich »

Hi Martin,

thank you very much. It works great.

I replaced the lines to (your hint "-E" and the full path):

sudo -u winccoa -E ${PVSS_PATH}/bin/WCCILpmon &

That would be something for the help ... ;-)

Best regards

Uwe Heinrich
Department ELBAS, Section Studies and Development
SIGNON Germany GmbH, Dresden

Heinrich
Posts:22
Joined: Wed Mar 23, 2011 11:27 am

Re: Run WinCCOA as service under Linux

Post by Heinrich »

Hi,

another problem again ...

WinCC OA runs now under Linux as service, but now I can't run the gedi and other ui. Following error message:

WCCILpmon1:No protocol specified
WCCILpmon1: WCCOAui: cannot connect to X server 127.0.0.1:1.0
WCCILpmon1 ... 24/pmon, Erhielt START Befehl von ::1, starte dem Manager WCCOAui(1) auf Index 28

I knew this errormessage in the past, but I fixed it with the command "xhost +". Thats never work now.
Maybe I can create an extra WinCCOA-project only for the gedi and uis at the same server for running uis, but ...

any other ideas ?

Thanks an best regards
Uwe Heinrich
Department ELBAS, Section Studies and Development
SIGNON Germany GmbH, Dresden

mkoller
Posts:741
Joined: Fri Sep 17, 2010 9:03 am

Re: Run WinCCOA as service under Linux

Post by mkoller »

Yes, that's expected. Pmon is run from init, which knows nothing about the later started X Server.
In fact, you should not run a UI via pmon when pmon runs as service, since all manager are in the background and the UI is user specific inside the X Session.
Quick-hack solution: pass the commandline argument "-display :0" to the UI in console after you used "xhost +" to allow acces to your X Server.
Better solution: run the UI from your desktop without using pmon, e.g. create a UI.desktop file for it, e.g.:

Code: Select all

[Desktop Entry]
Icon=/opt/WinCC_OA/3.13/pictures/vision_32x32.png
Name=WinCC_OA UI
Exec=/opt/WinCC_OA/3.13/bin/WCCOAui -proj test3x
Type=Application

Heinrich
Posts:22
Joined: Wed Mar 23, 2011 11:27 am

Re: Run WinCCOA as service under Linux

Post by Heinrich »

Hi Martin, Thank you for fast answer and help.

both works well

many Thanks
Uwe Heinrich

Heinrich
Posts:22
Joined: Wed Mar 23, 2011 11:27 am

Re: Run WinCCOA as service under Linux

Post by Heinrich »

Another way:
After problems with the env-vars at booting we use su instead sudo

USER=winccoa
su $USER -c "${PVSS_PATH}/bin/WCCILpmon &"

Best regards
Uwe Heinrich
Department ELBAS, Section Studies and Development
SIGNON Germany GmbH, Dresden

7 posts • Page 1 of 1