Hi,

I've found the startup scripts / environment scripts not really useful, as 
well. I've created my own (attached). Use them if you like.

stafsrv goes in /etc/init.d/ and make sure it's executable

Also, you need something like the following symlinks:
/etc/rc0.d/K08stafsrv -> /etc/init.d/stafsrv
/etc/rc1.d/K08stafsrv -> /etc/init.d/stafsrv
/etc/rc2.d/S82stafsrv -> /etc/init.d/stafsrv
/etc/rc3.d/S82stafsrv -> /etc/init.d/stafsrv
/etc/rc4.d/S82stafsrv -> /etc/init.d/stafsrv
/etc/rc5.d/S82stafsrv -> /etc/init.d/stafsrv
/etc/rc6.d/K08stafsrv -> /etc/init.d/stafsrv

In order to have it start upon boot, maybe, at the end, you need to
execute the following command, as well:
chkconfig --add stafsrv

Another thing is, I have changed the startSTAFProc.sh a little bit (attached) 
and have created a stopSTAFProc.sh (attached). These two files are referred by 
/etc/init.d/stafsrv.
I've also added the path to my JVM in STAFEnv.sh (attached). It points to 
/usr/local/staf/java/bin but that's because I chose to put a separate JRE in 
the STAF installation folder to avoid mixing the different JRE's I use.

Upon installation time I ran the installer like this:
./STAFInst -noreg -acceptlicense -bin /usr/bin -lib /usr/lib
By the way, I've tried different usages with [-type < m | r | f >] (like the m 
- minimal) but it causes more trouble than use, because some files don't get 
installed, so don't bother. But -bin /usr/bin -lib /usr/lib are important for 
me to avoid having to put the STAF binaries and libraries in the PATH and 
LD_LIBRARY_PATH.

To summarize:
stafsrv goes in /etc/init.d/ and make sure it's executable
startSTAFProc.sh goes in /usr/local/staf/ and make sure it's executable
stopSTAFProc.sh goes in /usr/local/staf/ and make sure it's executable
STAFEnv.sh goes in /usr/local/staf/

to start STAF:
/etc/init.d/stafsrv start

to stop STAF:
/etc/init.d/stafsrv stop

-- 
PAVEL TANKOV
Senior Quality Assurance Engineer, Secure Transport, Axway
P: +359 (2) 817-8449
Business Park Sofia, Mladost 4, Build. 11, fl. 2
1766 Sofia, Bulgaria
ptan...@axway.com - http://www.axway.com

On Monday 18 January 2010 22:31:07 Carl Myers wrote:
> Greetings all,
> 
> I am trying to set up STAF for use on an isolated network we are setting 
> up.  As such, we want things to be as resilient and automated as 
> possible.  The startup scripts / environment scripts which are 
> distributed with staf are not really suited for use from a standard 
> init.d script.  All the machines will run Linux.
> 
> STAFEnv.sh (maybe not included in the newest version?), for example, 
> uses `dirname $0`, so if it is sourced from a script which is not 
> located in the STAF home, it fails.  Additionally, if I put some of 
> these things (like setting LD_LIBRARY_PATH and CLASSPATH) directly in 
> the /etc/init.d/staf script I am writing, then we cannot push out new 
> versions using STAF itself, if they required these things to change. (we 
> use STAF to send out updates of STAF, among other things, but STAF is 
> not running as root and thus cannot update /etc/init.d/staf)
> 
> Has anyone already solved this problem, or does anyone out there have 
> some good /etc/init.d scripts for running STAF?  Anything which solves 
> all or some of these problems would be useful:
> 
> 1. Run STAF as non-root user
> 2. Run STAF at boot (using chkconfig?)
> 3. Supports the standard init.d script commands (start, stop, status, 
> condrestart)
> 4. Can be run from outside the staf home directory, by a script in an 
> arbitrary location (like /etc/init.d)
> 
> I have 1 and 2 down, but 3 and 4 I am still working on.
> 
> Thanks!
> 
> 

Attachment: stafsrv
Description: application/shellscript

Attachment: startSTAFProc.sh
Description: application/shellscript

Attachment: stopSTAFProc.sh
Description: application/shellscript

Attachment: STAFEnv.sh
Description: application/shellscript

------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users

Reply via email to