Autostart of the project

Find and share HowTos to various installations / configurations!
9 posts • Page 1 of 1
vedadramovic
Posts:121
Joined: Mon Apr 07, 2014 10:36 am

Autostart of the project

Post by vedadramovic »

Hello,
I am trying to configure autostart of the project, on a boot, in Linux with following bash file:

/opt/WinCC_OA/3.12/bin/lm_ip -a lockmgr -f 600
/opt/WinCC_OA/3.12/bin/WCCOAui -console +config cofig.pa &
sleep 20
/opt/WinCC_OA/3.12/bin/WCCILpmon -PROJ Gaj -config /home/WinCC_OA_Projects/Gaj/config/config -command START_ALL &

when executed on one server, error is thrown:
WCCilpmon1: Failed to Connect: connection refused (111)

On a manual start of a project Gaj everything goes fine.

Same bash file is used on other redundant side of the same project and it works fine.

How can I solve this issue?

Another question - How can I make autostart of specific project on Windows?

Thanks in advance,
Vedad

Gertjan van Schijndel
Posts:634
Joined: Mon Aug 02, 2010 10:37 am

Re: Autostart of the project

Post by Gertjan van Schijndel »

Why do you not use the standard functionality as described in the online help under: 'Installation' -> 'Linux'/'Windows' -> 'WinCC OA as a service'?

vedadramovic
Posts:121
Joined: Mon Apr 07, 2014 10:36 am

Re: Autostart of the project

Post by vedadramovic »

I do not use it because it does not work.
If WCCILpmon is started as root I cannot use any of gui interfaces.

if I use "sudo -u bst_user WCCILpmon &" to switch root user to bst_user, as suggested in help in "winccoa" file, it does not work.
if I use "su bst_user -c WCCILpmon &" instead it will not work after reboot if I do not insert "sleep 20" before start and export of oracle client path.

When all of this is solved I cannot start GEDI from console or any of user interfaces.
When project is stopped process WCCILdatabg allways stays on. So if I want to start the project again, I have to kill this process manually.

Please help me solve this issue of autostart configuration.
thanks,
Vedad

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

Re: Autostart of the project

Post by mkoller »

When you start pmon as a service during boot (which you definitely should do), then please do not start the UI manager via pmon!
pmon is started long before there is an X session. Therefore pmon has nothing to do with the currently logged in user.
Start the UI from the shell (or create a .desktop file doing so).
Alternatively you could pass "-display :0.0" as commandline argument if you really want to let pmon start the UI for the current user session (which is a bad idea, since
the ui then runs as the user of the pmon process!).

To start pmon under a different user, change the /etc/init.d/winccoa script to start it like this:

Code: Select all

sudo -u yourUser -E WCCILpmon &
Note the -E which tells sudo to pass the environment.

vedadramovic
Posts:121
Joined: Mon Apr 07, 2014 10:36 am

Re: Autostart of the project

Post by vedadramovic »

Hi Martin,
First of all thank you for your help and sorry for bothering you.

When I start pmon as a service with other user than root
as suggested:
sudo - u yourUser -E WCCILpmon &

RDB manager is not starting.

I am able to start the user interface (gedi) from shell but afterwards it seems that WCCoa Console becomes irresponsive.
I am starting gedi with following code:

/opt/WinCC_OA/3.12/bin/WCCOAui -PROJ ProjName -pmonIndex 1 -m gedi -num 1 &

What should I do next?
thanks,
Vedad

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

Re: Autostart of the project

Post by mkoller »

When you start any manager yourself, do not pass -pmonIndex (it is the index the started manager finds itself in the list of manager you see in console. Your UI manager should not be listed there, so there is no index).
Regarding RDB manager: I'm no expert in RDB manager questions, but still: what happens ?
Any log output ?
BTW: make sure that the user which runs pmon (and therefore all other managers) is also allowed to read all files and to write to the project directory (e.g. logfiles, database, ...)

vedadramovic
Posts:121
Joined: Mon Apr 07, 2014 10:36 am

Re: Autostart of the project

Post by vedadramovic »

Hi Martin,
thank you very much for your help.
excluding -pmonIndex helped.

Regarding RDB manager it seems that process WCCILdatabg is not started when project is started from init.d scripts using winccoa script with "sudo -u MyUser -E WCCILpmon &".
If I start the project from the GUI (WinCCOA administration or console) this process WCCILdatabg is started.

In tog I cannot see any errors. The difference between good and bad case is that it bad case it finds OCIWrapper_11 an 12 while in good case it finds only OCIWrapper_12.so
WCCOArdb97:WCCOArdb (97), 2015.10.27 09:01:16.006, WORK, PVSSFileSys::fileExists found file: "/opt/WinCC_OA/3.12/bin/OCCIWrapper_12.so"
WCCOArdb97:WCCOArdb (97), 2015.10.27 09:01:16.006, WORK, PVSSFileSys::fileExists found file: "/opt/WinCC_OA/3.12/bin/OCCIWrapper_11.so"
WCCOArdb97:WCCOArdb (97), 2015.10.27 09:01:16.007, WORK, Manager::exit called

also there is
WCCOArdb99:WCCOArdb (97), 2015.10.27 09:01:18.029, INPUTREADY, Got message 0 from (SYS: 0 Data -num 0 CONN: 1)
WCCOArdb99:WCCOArdb (97), 2015.10.27 09:01:18.029, DISPATCH, System time difference between localhost and linux-u9kp.site is about 0 sec. useServerTime is set to 0

Thanks again,
Vedad

Gertjan van Schijndel
Posts:634
Joined: Mon Aug 02, 2010 10:37 am

Re: Autostart of the project

Post by Gertjan van Schijndel »

Are the environment variables set properly for the oracle client, when the service starts?

vedadramovic
Posts:121
Joined: Mon Apr 07, 2014 10:36 am

Re: Autostart of the project

Post by vedadramovic »

Hello Gertjan,
I suppose that environment variables are set properly, because if I start it from WinCCOA console app RDB works. If I start it manually using "systemctl start winccoa" RDB does not work (even when following oracle environment variables are inserted into winccoa script)

export ORACLE_HOME=/home/bst/app/bst/product/12.1.0/client_3
export PATH=/home/bst/app/bst/product/12.1.0/client_3/bin:$PATH
export LD_LIBRARY_PATH=/home/bst/app/bst/product/12.1.0/client_3/lib/:$LD_LIBRARY_PATH

Good news is if used
su MyUser -c
instead of
sudu -u MyUser -E
RDB works.

Regards,
Vedad

9 posts • Page 1 of 1