Baanboard.com

Go Back   Baanboard.com > Forum > Baan Quick Support: Functional & Technical > Tools Development

User login

Frontpage Sponsor

Main

Poll
When will you move your ERP to the cloud?
We are on the cloud already!
20%
Next year
8%
from 2-3 years
8%
from 4-5 years
16%
Never!
48%
Total votes: 50

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 8th February 2007, 05:04
Debdas Banerjee Debdas Banerjee is offline
Member
 
Join Date: Feb 2003
Location: Mumbai
Posts: 90
Debdas Banerjee is on a distinguished road
Baan: 4c4 - DB: sql-2000/ informix - OS: Advance server / unix
Activate job from Program script
Baan: Baan IVc4
C/S: Client

Dear frinends,

I want to run a job from my program script ( rc.start jobname). Previously I run shell script from my program script. This time it is not activated my job.
I am giving my code below

We are using Unix as OS.

path.f = "/usr4/baan4/bse/etc/"
cmd = sprintf$("sh %src.startjob %s", path.f,jobs.t)
jobrun = shell(cmd,0)
__________________
Deb
Arise Awake & Stop not till the Goal is Reached...........Swami Vivekananda.
Reply With Quote
  #2  
Old 8th February 2007, 15:27
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 6,819
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
If you start a shell manually and type in the command does it work? Typically I do not use sh in any of my UNIX commands when I shell out, just the command itself - I do not think that is the problem. Are you getting any errors or messages? Can you set it so you see what happens(use 128 or SHELL_MWINDOW). It might give you the info you need to fix the problem.
__________________
Mark

GO Cards!
My latest mantra - make sure you have latest stpapi patches and the latest session object. If on LN then please explore the option of using DAL2 functionality.

Shared Solutions for Baan systems provided free by Baan Board.
Play the Google game and help Baanboard get better rankings. Do your part. Click here to find how.
Reply With Quote
  #3  
Old 9th February 2007, 10:16
Debdas Banerjee Debdas Banerjee is offline
Member
 
Join Date: Feb 2003
Location: Mumbai
Posts: 90
Debdas Banerjee is on a distinguished road
Baan: 4c4 - DB: sql-2000/ informix - OS: Advance server / unix
Hi Mark_h,

Thanks for reply.

This Shell commands works if I give it in command prompt.

I am giving a exmple below which I used in my session and it is working.

cmd = sprintf$("/bin/login02.sh %s",LOGNAME$)
out = shell(cmd,0)
if out <> 0 then
message("Serious Error !!")
endif

I have tried your option also but nothing has come out.
path.f = "/usr4/baan4/bse/etc/"
cmd = sprintf$("sh %src.startjob %s", path.f,jobs.t)
jobrun = shell(cmd,SHELL_MWINDOW)
__________________
Deb
Arise Awake & Stop not till the Goal is Reached...........Swami Vivekananda.
Reply With Quote
  #4  
Old 9th February 2007, 13:38
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 6,819
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
You did not get an error message or something with jobrun = shell(cmd,SHELL_MWINDOW) this command? I do not know enough about the shell(or UNIX) level to see a problem. I am wondering if the sh command is not the full shell and all the variables are not set for the rc.startjob to work. What does login02.sh look like? Does it set any environment variables or anything like that?
__________________
Mark

GO Cards!
My latest mantra - make sure you have latest stpapi patches and the latest session object. If on LN then please explore the option of using DAL2 functionality.

Shared Solutions for Baan systems provided free by Baan Board.
Play the Google game and help Baanboard get better rankings. Do your part. Click here to find how.
Reply With Quote
  #5  
Old 9th February 2007, 15:27
Debdas Banerjee Debdas Banerjee is offline
Member
 
Join Date: Feb 2003
Location: Mumbai
Posts: 90
Debdas Banerjee is on a distinguished road
Baan: 4c4 - DB: sql-2000/ informix - OS: Advance server / unix
hI,

I am not getting any error message. Nothing showing any message.
login2.sh is one more shell script.
__________________
Deb
Arise Awake & Stop not till the Goal is Reached...........Swami Vivekananda.
Reply With Quote
Sponsored Links
  #6  
Old 9th February 2007, 16:32
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 6,819
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Try this cmd = sprintf$("%src.startjob %s", path.f,jobs.t) and see if you get an error. I am wondering if the second sh command is maybe preventing you from seeing the error.
__________________
Mark

GO Cards!
My latest mantra - make sure you have latest stpapi patches and the latest session object. If on LN then please explore the option of using DAL2 functionality.

Shared Solutions for Baan systems provided free by Baan Board.
Play the Google game and help Baanboard get better rankings. Do your part. Click here to find how.
Reply With Quote
  #7  
Old 10th February 2007, 05:13
Debdas Banerjee Debdas Banerjee is offline
Member
 
Join Date: Feb 2003
Location: Mumbai
Posts: 90
Debdas Banerjee is on a distinguished road
Baan: 4c4 - DB: sql-2000/ informix - OS: Advance server / unix
Hi,

Thanks again for replying.

I have tried this also , there is no error message.
funny part is jobrunis returns 0 value.
0 means command has executed.
I have logged a case in SSA/INFOR , they are also not saying anything.
It seems I have to give up this option.

exm:
path.f = "/usr4/baan4/bse/etc/"
cmd = sprintf$("%src.startjob %s", path.f,jobs.t)
jobrun = shell(cmd,0)
__________________
Deb
Arise Awake & Stop not till the Goal is Reached...........Swami Vivekananda.
Reply With Quote
  #8  
Old 12th February 2007, 13:18
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 6,819
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Sorry I am not much help. This should work and I do not know what I am missing. You may have to wait for the support center, unless someone else on the board can think of something.
__________________
Mark

GO Cards!
My latest mantra - make sure you have latest stpapi patches and the latest session object. If on LN then please explore the option of using DAL2 functionality.

Shared Solutions for Baan systems provided free by Baan Board.
Play the Google game and help Baanboard get better rankings. Do your part. Click here to find how.
Reply With Quote
  #9  
Old 12th February 2007, 14:31
george7a's Avatar
george7a george7a is offline
Guru
 
Join Date: May 2004
Location: Nazareth
Posts: 1,487
george7a is on a distinguished road
Baan: IVc, 5.0 b, 5.0 c, LN 6.1 - DB: MS SQL, Oracle - OS: Windows 2000, 2003 & UNIX
Hi,

Are you able to run any other simple UNIX scripts from within your Baan script?

Does the (UNIX) user you are logged in Baan have an "execute" permission to run the job script?

- George
__________________
_
George Abdo
NAZDAQ - Your Documents, Your Way.
Reply With Quote
  #10  
Old 12th February 2007, 14:48
günther günther is offline
Guru
 
Join Date: Jan 2002
Location: Ehingen, Germany
Posts: 561
günther is on a distinguished road
Baan: IVc4 - DB: Informix - OS: HP-UX
Post

I would do the following:
1. Start a simple shell script from within baan, say "/tmp/test.sh".
2. In that shell script, log anything you can think of, e.g.
Code:
#!/bin/sh

JOB=$1

(
  echo "*** environment"
  env

  echo "*** user id"
  id

  echo "*** current directory"
  pwd

  # ... maybe something more

  echo "*** now starting JOB $JOB ..."
  $BSE/etc/rc.startjob $JOB
  rc=$?

  echo "rc.startjob returned $rc"

) >/tmp/test.out 2>&1

exit 0 # reasonable return code for baan
Reply With Quote
  #11  
Old 14th February 2007, 16:34
Hitesh Shah's Avatar
Hitesh Shah Hitesh Shah is offline
Guru
 
Join Date: Nov 2001
Location: Mumbai,India
Posts: 1,855
Hitesh Shah is on a distinguished road
Baan: triton,Baan IVc4 , ERP Ln - DB: Oracle/Bisam/SQL 2000/SQL 2005 - OS: Sun Solaris/Windows 2003
execute / user permission

Are execute permission available for user running the job in script . Status 0 means script is executed but with an error written in script . Also it could be issue of different shell (sh,ksh, csh etc) , different OS variables (e.g BSE , BSE_TMP , $HOME etc). Step-by-step suggested by Gunther is the best approach .
Reply With Quote
  #12  
Old 15th February 2007, 14:45
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 6,819
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
I think you all are mis-understanding. Deb can already run a shell script. What is wanted is to replace the script with rc.startjob. It appears there is a problem with that.
__________________
Mark

GO Cards!
My latest mantra - make sure you have latest stpapi patches and the latest session object. If on LN then please explore the option of using DAL2 functionality.

Shared Solutions for Baan systems provided free by Baan Board.
Play the Google game and help Baanboard get better rankings. Do your part. Click here to find how.
Reply With Quote
  #13  
Old 15th February 2007, 16:10
Kozure Ohashi's Avatar
Kozure Ohashi Kozure Ohashi is offline
Guru
 
Join Date: Dec 2003
Location: Tokyo-Otsuka
Posts: 324
Kozure Ohashi is on a distinguished road
Baan: Baan IV c4 SP 19, ERP LN 6.1 FP3 - DB: 10g R2 - OS: Linux SLES 10 64 Bit
Sample

Dear Debdas,

just for testing, can you call the rc.startjob without parameters as one complete string:

e.g. for job25:

ret = shell("/usr4/baan4/bse/etc/rc.startjob job25", 0)

If this not works, i think (but maybe i am wrong) you are running the shell script and the baan script with different users. (shell = root // baan = bsp)

Try this:

ret = shell("touch /usr4/baan4/bse/etc/my.testfile", 0)

Now you can check the user / group / permissions of the user running the command from BaaN in Unix.

On our Unix System the rc.startjob has only priviliges for bsp:

rwxr_x___ bsp bsp rc.startjob

It is called on unix level with crontab.

Regards,

Kozure
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to print Postcript in landscape orientation heliopaixao Tools Administration & Installation 8 28th July 2006 13:39
Activate the Job using the AFS noorulhaq AFS/DDC/OLE: Function servers 4 28th December 2005 14:42
Executing Shell Script from Program Script v_chandra Tools Development 3 26th October 2005 07:57
IS it possible to activate a particular job from Program script jaymukh Tools Development 2 21st June 2002 21:55
$BSE/bin files pjohns Tools Administration & Installation 8 21st September 2001 13:15


All times are GMT +2. The time now is 21:00.


©2001-2017 - Baanboard.com - Baanforums.com