rduncan10
27th January 2010, 20:08
I have a situation where, from time to time, a batch job user will not be logged out of the system when the Baan batch job is finished running. is there anyway to force the user to log out?

We are using SUSE Linux, and the Baan jobs are run from cron. The crontab entry is like this: /baan/bse/etc/rc.startjob JOBNAME

The job in question runs every quarter of an hour. The job usually only takes a minute or two to run. Usually there is no problem: the job runs fine and the cron logs the user out when its done.

But from time to time cron won't log the user out. The job keeps running on schedule, and the next time it runs, another instance of the user is created and left logged in. Eventually we run out of licenses.

There are no errors reported in the Baan job messages, Baan logs or Linux system logs. The sessions in the job all run.

Is there a way to prevent this from happening?

Thanks,
Rob

jshanks
28th January 2010, 02:02
Rob,
I faced a similar situation with the process not completing. In my case, the session in question was a customized one so we thought that something is going wrong with the code. If this is a customized session then, the thing to check is whether you have anything in the code that is hard-coded to send the output to Display under certain conditions. The data might be meeting that condition, the output goes to display and waits for someone to kill it. Even with standard sessions like print PO and print SO, some of them are set with a default device that goes might be going to display. Those are some of the things to check.

In my case, none of these were found to be a problem but the job would just hang without exiting. The solution is going to sound very strange but it is the only thing that worked...

I used the bshcmd6.1 command to send a "Wake up signal" to the bshell process. As soon as I send this signal, the job used to complete and the process ended. The command line was something like this:

bshcmd6.1 -w10 -u10 -s -p <bshell pid>

Regards
Jay

jshanks
28th January 2010, 02:45
Another solution might be define session_timeout either globally or for the job users (in the u file). This way they will terminate after a while of inactivity.

rduncan10
28th January 2010, 22:51
Thanks. I disabled the job in cron last night so Baan wouldn't run out of licenses while I was sleeping. When I reenabled it this morning, the problem stopped.

But I know it will happen again, so I'll try the session_timeout option.

One question. If I have a batch job that will run for a long time, say rolling standards or something, will session_timeout kill this, or does it only effect idle sessions?

Rob

jshanks
28th January 2010, 22:56
Yes, session_timeout will end up killing those. For such jobs, if possible you can run them under a different ID and put session_timeout:0 in the u file or start the job with a session_timeout=0 in the rc.startjob shell script (you can create a different version of this script).

dave_23
29th January 2010, 01:01
You may try setting ds_timeout_detect:30

That will close the bshell if the driver goes away after 30 minutes.


I'm not sure about session_timeout dropping running sessions... it's intent is to close idle bshell's, if the bshell or the driver is working it should continue just fine.

Dave