SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
RARun fails on remote Linux agent

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
RARun fails on remote Linux agent
Author Message
Ben Ridout



Joined: 14 Jul 2005
Posts: 5

Post RARun fails on remote Linux agent Reply with quote

I've finally managed to get past my authentication issues in connecting
to a Linux RA agent from Win2k.

My new problem is that any commands I run fail.

My script:
Dim process_id, number
RAConnect "edwteam", 1096, "ridoutb", "xxxxxx"
RARun "/usr/local/backup.sh", process_id
RADisconnect

I found a couple threads with similar issues here on the forum.
http://www.softtreetech.com/cgi_bin/config.cgi?noframes&read=6211

The advice here was to run this:
Dim server_listening, boolean
PingPort "edwteam", 1096, server_listening
MessageBox server_listening

It returns TRUE for me.

I run the ra_server using this:
./server.sh -p 1096 of log.txt

log.txt contains:
14 Jul 2005 11:54:17 INFO [run]: start
14 Jul 2005 11:54:17 INFO [authenticate]: start. user = ridoutb
14 Jul 2005 11:54:17 INFO [authenticate]: end. result = OK
14 Jul 2005 11:54:17 ERROR [run]: java.lang.RuntimeException: worker.sh execute failed!
14 Jul 2005 11:54:17 INFO [run]: end

Permissions:
-rwxr-xr-x 1 root root 115 2005-02-03 17:43 server.sh
-rwxr-xr-x 1 root root 140 2005-02-03 17:43 worker.sh
-rwxr-xr-x 1 root root 57 2005-07-13 15:55 runner.sh

My SYSLOG is empty. No output at all.

It looks like worker.sh is failing to execute my commands,
but I have no insight as to why. Any help would be greatly appreciated!

Thanks,
-Ben Ridout


Thu Jul 14, 2005 12:00 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7975

Post Re: RARun fails on remote Linux agent Reply with quote

Please make sure that .sh files (if they were transfered from Windows or edited locally) have only end-of-lines and no carriage returns.

To ensure worker.sh is working try running it from shell as "./worker ls"

: I've finally managed to get past my authentication issues in connecting
: to a Linux RA agent from Win2k.

: My new problem is that any commands I run fail.

: My script: Dim process_id, number
: RAConnect "edwteam", 1096, "ridoutb", "xxxxxx"
: RARun "/usr/local/backup.sh", process_id
: RADisconnect

: I found a couple threads with similar issues here on the forum.
: http://www.softtreetech.com/cgi_bin/config.cgi?noframes&read=6211

: The advice here was to run this: Dim server_listening, boolean
: PingPort "edwteam", 1096, server_listening
: MessageBox server_listening

: It returns TRUE for me.

: I run the ra_server using this: ./server.sh -p 1096 of log.txt

: log.txt contains: 14 Jul 2005 11:54:17 INFO [run]: start
: 14 Jul 2005 11:54:17 INFO [authenticate]: start. user = ridoutb
: 14 Jul 2005 11:54:17 INFO [authenticate]: end. result = OK
: 14 Jul 2005 11:54:17 ERROR [run]: java.lang.RuntimeException: worker.sh
: execute failed!
: 14 Jul 2005 11:54:17 INFO [run]: end

: Permissions: -rwxr-xr-x 1 root root 115 2005-02-03 17:43 server.sh
: -rwxr-xr-x 1 root root 140 2005-02-03 17:43 worker.sh
: -rwxr-xr-x 1 root root 57 2005-07-13 15:55 runner.sh

: My SYSLOG is empty. No output at all.

: It looks like worker.sh is failing to execute my commands,
: but I have no insight as to why. Any help would be greatly appreciated!

: Thanks,
: -Ben Ridout

Thu Jul 14, 2005 12:17 pm View user's profile Send private message
Ben Ridout



Joined: 14 Jul 2005
Posts: 5

Post Re: RARun fails on remote Linux agent Reply with quote

: Please make sure that .sh files (if they were transfered from Windows or
: edited locally) have only end-of-lines and no carriage returns.
The files look ok. No ^Ms or anything.

: To ensure worker.sh is working try running it from shell as
: "./worker ls"

I tried:
./worker.sh
./ worker.sh ls (.sh seems to be required)

Output follows:
root@edwteam:/opt/ra_server # ./worker.sh
su: invalid option -- l
Usage: su [OPTS] [-] [username [ARGS]]

- make this a login shell

-c, --command=

pass command to the invoked shell using its -c

option

-m, -p, --preserve-environment

do not reset environment variables, and keep the

same shell

-s, --shell=

use shell instead of the default in /etc/passwd

root@edwteam:/opt/ra_server # ./worker.sh ls
su: invalid option -- l
Usage: su [OPTS] [-] [username [ARGS]]

- make this a login shell

-c, --command=

pass command to the invoked shell using its -c

option

-m, -p, --preserve-environment

do not reset environment variables, and keep the

same shell

-s, --shell=

use shell instead of the default in /etc/passwd

Thu Jul 14, 2005 12:30 pm View user's profile Send private message
Ben Ridout



Joined: 14 Jul 2005
Posts: 5

Post Re: RARun fails on remote Linux agent Reply with quote

: Please make sure that .sh files (if they were transfered from Windows or
: edited locally) have only end-of-lines and no carriage returns.
Contents of my worker.sh file:
#!/bin/sh
exec su -l $1 -c "$2/bin/java -Draserver.path=$3 -cp $3/ra_server.jar:$3/log4j-1.2.8.jar com.softtree.raserver.Worker $4 $5 $6"

: To ensure worker.sh is working try running it from shell as
: "./worker ls"

As I mentioned, I get this:

root@edwteam:/opt/ra_server # ./worker.sh ls
su: invalid option -- l
Usage: su [OPTS] [-] [username [ARGS]]

- make this a login shell

-c, --command=

pass command to the invoked shell using its -c

option

-m, -p, --preserve-environment

do not reset environment variables, and keep the

same shell

-s, --shell=

use shell instead of the default in /etc/passwd

It seems like the "-l" in "exec su -l $1 -c "$2/bin/java..." was causing a problem.
I removed it and my job now works! Hurray!

It still may help me and others to know why that -l was a problem, but I am happy to have a successful job run. Thank you for the assistance!

-Ben Ridout


Thu Jul 14, 2005 12:40 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7975

Post Re: RARun fails on remote Linux agent Reply with quote

What did you get in the worker.sh file? Which Linux version are you running?

: The files look ok. No ^Ms or anything.

: I tried: ./worker.sh
: ./ worker.sh ls (.sh seems to be required)

: Output follows: root@edwteam:/opt/ra_server # ./worker.sh
: su: invalid option -- l
: Usage: su [OPTS] [-] [username [ARGS]]

: - make this a login shell

: -c, --command=

: pass command to the invoked shell using its -c

: option

: -m, -p, --preserve-environment

: do not reset environment variables, and keep the

: same shell

: -s, --shell=

: use shell instead of the default in /etc/passwd

: root@edwteam:/opt/ra_server # ./worker.sh ls
: su: invalid option -- l
: Usage: su [OPTS] [-] [username [ARGS]]

: - make this a login shell

: -c, --command=

: pass command to the invoked shell using its -c

: option

: -m, -p, --preserve-environment

: do not reset environment variables, and keep the

: same shell

: -s, --shell=

: use shell instead of the default in /etc/passwd

Thu Jul 14, 2005 12:40 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7975

Post Re: RARun fails on remote Linux agent Reply with quote

Oh, I see now, this is Java agent using password-based security. I though you are using the native code version.

1. To enable SYSLOG you need to add -s option to the agent start command. here is an example
./server.sh -p 1096 -f log.txt -s

2. Make sure you are starting the server as root so that it can use the "su" command for user sessions to set the user account environment to the process user.

: Contents of my worker.sh file: #!/bin/sh
: exec su -l $1 -c "$2/bin/java -Draserver.path=$3 -cp
: $3/ra_server.jar:$3/log4j-1.2.8.jar com.softtree.raserver.Worker $4 $5
: $6"

: As I mentioned, I get this: root@edwteam:/opt/ra_server # ./worker.sh ls
: su: invalid option -- l
: Usage: su [OPTS] [-] [username [ARGS]]

: - make this a login shell

: -c, --command=

: pass command to the invoked shell using its -c

: option

: -m, -p, --preserve-environment

: do not reset environment variables, and keep the

: same shell

: -s, --shell=

: use shell instead of the default in /etc/passwd

: It seems like the "-l" in "exec su -l $1 -c
: "$2/bin/java..." was causing a problem.
: I removed it and my job now works! Hurray!

: It still may help me and others to know why that -l was a problem, but I am
: happy to have a successful job run. Thank you for the assistance!

: -Ben Ridout

Thu Jul 14, 2005 12:52 pm View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.