Hi,
I am facing an intersting issue. I want to start staf on a host(RHEL 5 - 64
bit) when it boots up. Now I want to run a command on it remotely.
To start staf I have added a script in /etc/init.d so that it starts when host
boots up
Below is the snippet of the script
----
echo -n "Starting STAF: "
PATH=/usr/local/staf/bin:$PATH
LD_LIBRARY_PATH=/usr/local/staf/lib:$LD_LIBRARY_PATH
CLASSPATH=/usr/local/staf/lib/JSTAF.jar:/usr/local/staf/samples/demo/STAFDemo.jar:$CLASSPATH
STAFCONVDIR=/usr/local/staf/codepage
export PATH LD_LIBRARY_PATH CLASSPATH STAFCONVDIR
/usr/local/staf/bin/STAFProc >/dev/null 2>&1 &
------------
Good news is that staf starts successfully. Bad news is that I am not able to
issue all the commands
[arv...@achandra-dev1 local]$ staf 192.168.1.69 process start wait returnstdout
shell command "ls -l"
Response
--------
{
Return Code: 0
Key : <None>
Files : [
{
Return Code: 0
Data : total 258
drwxr-xr-x 2 root root 4096 Feb 27 2008 bin
drwxr-xr-x 3 root root 4096 May 6 2008 blaster
drwxr-xr-x 4 root root 1024 Feb 27 2008 boot
drwxr-xr-x 11 root root 3740 Aug 14 10:44 dev
drwxr-xr-x 92 root root 12288 Aug 14 10:44 etc
drwxr-xr-x 3 root root 4096 Sep 16 2008 home
drwxr-xr-x 12 root root 4096 Feb 27 2008 lib
drwxr-xr-x 8 root root 4096 Feb 27 2008 lib64
drwx------ 2 root root 16384 Feb 27 2008 lost+found
drwxr-xr-x 2 root root 4096 Aug 14 10:44 media
drwxr-xr-x 2 root root 0 Aug 14 10:44 misc
drwxr-xr-x 3 root root 4096 Sep 19 2008 mnt
drwxr-xr-x 2 root root 0 Aug 14 10:44 net
drwxr-xr-x 3 root root 4096 May 6 2008 opt
dr-xr-xr-x 87 root root 0 Aug 14 10:43 proc
drwxr-x--- 18 root root 4096 Aug 13 17:30 root
drwxr-xr-x 2 root root 12288 Jul 10 14:16 sbin
drwxrwxrwx 2 root root 4096 Aug 13 16:14 sdb
drwxr-xr-x 4 root root 0 Aug 14 10:43 selinux
drwxr-xr-x 2 root root 4096 Oct 10 2006 srv
drwxr-xr-x 11 root root 0 Aug 14 10:43 sys
drwxrwxrwt 8 root root 4096 Aug 14 10:44 tmp
drwxr-xr-x 15 root root 4096 Feb 27 2008 usr
drwxr-xr-x 21 root root 4096 Feb 27 2008 var
}
]
}
Now I run this command
[arv...@achandra-dev1 local]$ staf 192.168.1.69 process start wait returnstdout
shell command "fdisk -l"
Response
--------
{
Return Code: 0
Key : <None>
Files : [
{
Return Code: 0
Data :
}
]
}
This is the information about trust level
[arv...@achandra-dev1 local]$ staf 192.168.1.69 trust list
Response
--------
Type Entry Trust Level
------- ------ -----------
Default <None> 3
Machine *://* 5
Not sure why I am not able to issue this command
Now I log into the host as root and stop staf. Then restart STAF
Now again I issue command and it works
[arv...@achandra-dev1 local]$ staf 192.168.1.69 process start wait returnstdout
shell command "fdisk -l"
Response
--------
{
Return Code: 0
Key : <None>
Files : [
{
Return Code: 0
Data :
Disk /dev/sda: 5368 MB, 5368709120 bytes
255 heads, 63 sectors/track, 652 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 652 5132767+ 8e Linux LVM
Disk /dev/sdb: 314 MB, 314572800 bytes
10 heads, 60 sectors/track, 1024 cylinders
Units = cylinders of 600 * 512 = 307200 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 1024 307199+ 83 Linux
}
]
}
The version of STAF is 3.3.0
Am I missing something.
Thanks
Arvind
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
staf-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/staf-users