Mike,

Thanks to all for your assistance. And an extra thank you to Michael Holzheu.

What I ended up doing was having boot.local call ekmstart:


LINUXEKM:/etc/rc.d # cat boot.local
#! /bin/sh
#
# Copyright (c) 2002 SuSE Linux AG Nuernberg, Germany.  All rights reserved.
#
# Author: Werner Fink <[email protected]>, 1996
#         Burchard Steinbild, 1996
#
#
#
# script with local commands to be executed from init on system startup
#
# Here you should add things, that should happen directly after booting
# before we're going to the first run level.
#
/home/ekmserv/keymanager/ekmstart


LINUXEKM:/home/ekmserv/keymanager # cat ekmstart
#!/bin/bash
#
# Start Enterprise Key Manager (EKM)
# This script i also called from /etc/rc.d/boot.local
#
export CLASSPATH=IBMKeyManagementServer.jar
export PATH=/opt/ibm/java2-s390x-50/ibm-java2-s390x-50/bin/:$PATH
pid=$(ps -ef | grep -i com.ibm.keymanager.EKMServer | grep -v grep | \
        head -1 | awk '{print $2}')
if [ "$pid" != "" ]; then
        echo "EKM already running with pid $pid"
else
        echo $pid
        java -cp IBMKeyManagementServer.jar \
             com.ibm.keymanager.EKMLaunch 
/home/ekmserv/keymanager/KeymanagerConfig.properties
fi

Ray Waters


-----Original Message-----
From: Linux on 390 Port [mailto:[email protected]] On Behalf Of Mike 
Friesenegger
Sent: Monday, February 22, 2010 1:03 PM
To: [email protected]
Subject: Re: Run a script at boot time

Yes, you will need to provide the path to java.

I am not a java expert but you may also need to specify the classpath for java 
to find com.ibm.keymanager.EKMLaunch.  I typically need a couple attempts to 
get this right.

I think you are on the right path (pun intended!)

Mike

>>> On 2/22/2010 at 11:48 AM, in message
<54c8cda6cb5ed2438e63b98905af489adc8aa8c...@excluster5.corp.osinet.biz>, Ray
Waters <[email protected]> wrote:
> Mike,
>
> I added a script named /etc/init.d/after.local and it did not work:
>
> Master Resource Control: Running /etc/init.d/after.local""
> /etc/init.d/after.local: line 2: java: command not found""
> Ý1A..failedMaster Resource Control: runlevel 3 has been reached""
> Skipped services in runlevel 3: "Ý80C"Ý23Dsmbfs nfs splash""
>
> Here is the script. Same as the script I execute to manually start EKM.
> cat after.local
> #!/bin/bash
> java com.ibm.keymanager.EKMLaunch KeymanagerConfig.properties
>
> LINUXEKM:/etc/init.d #
>
>
> cd $java_home
> LINUXEKM:/opt/ibm/java2-s390x-50/ibm-java2-s390x-50
>
> Do I need to add a path?
>
> Ray Waters
>
> -----Original Message-----
> From: Linux on 390 Port [mailto:[email protected]] On Behalf Of Mike
> Friesenegger
> Sent: Monday, February 22, 2010 10:53 AM
> To: [email protected]
> Subject: Re: Run a script at boot time
>
> Or - create /etc/init.d/after.local which calls the script.  /etc/init.d/rc
> checks for after.local and will execute it if exists.  after.local is
> executed after the runlevel has been reached.
>
> Mike
>
>>>> On 2/22/2010 at 09:39 AM, in message
> <[email protected]>, Scott Rohling
> <[email protected]> wrote:
>> Or - call the script in /etc/rc.local ..  not as elegant as doing a proper
>> init script, etc - but may be simplest for your purposes..
>>
>> Scott
>>
>> On Mon, Feb 22, 2010 at 9:35 AM, Christian Paro
>> <[email protected]>wrote:
>>
>>> Create an init script based on (or which calls) the script you've been
>>> using, and use `chkconfig` to enable it for the appropriate runlevel (which
>>> depends on what services you expect to already be up at the time your
>>> script
>>> is to be run). Having it on for the runlevel you normally boot into
>>> (generally 3 or 5) would be a safe approach, since you've up to this point
>>> been running the script manually after login.
>>>
>>> You can look at the other scripts in /etc/init.d as templates for writing
>>> an
>>> init script, if you've never written one before.
>>>
>>> On Mon, Feb 22, 2010 at 11:26 AM, Ray Waters
>>> <[email protected]>wrote:
>>>
>>> > Still learning, what would be the safest way to run this script after
>>> Linux
>>> > has booted?  I have been manually executing the script but now want the
>>> > script to automatically run whenever I XAUTOLOG LINUXEKM.
>>> >
>>> > Welcome to SUSE Linux Enterprise Server 10 SP2 (s390x) - Kernel
>>> > 2.6.16.60-0.21-default (ttyS0).
>>> >
>>> > echo $PATH
>>> >
>>> >
>>> /opt/ibm/java2-s390x-50/ibm-java2-s390x-50/bin:/opt/ibm/java2-s390x-50/ibm-java2
>>> >
>>> >
>>>
>>
> -s390x-50/jre/bin:/home/ekmserv/bin:/usr/local/bin:/usr/bin:/usr/X11R6/bin:/bin
>
>> :
>>> >
>>> >
>>>
>>
> /usr/games:/opt/gnome/bin:/opt/kde3/bin:/usr/lib/mit/bin:/usr/lib/mit/sbin:/h
>> ome
>>> > /ekmserv/keymanager
>>> >
>>> > The script name is ekmlaunch
>>> > pwd
>>> > /home/ekmserv/keymanager
>>> > ekms...@linuxekm:~/keymanager> cat ekmlaunch
>>> > cat ekmlaunch
>>> > #!/bin/bash
>>> > java com.ibm.keymanager.EKMLaunch KeymanagerConfig.properties
>>> >
>>> > Thanks,
>>> > Ray Waters
>>> >
>>> > ________________________________
>>> > NOTICE:
>>> > This e-mail is intended solely for the use of the individual to whom it
>>> is
>>> > addressed and may contain information that is privileged, confidential or
>>> > otherwise exempt from disclosure. If the reader of this e-mail is not the
>>> > intended recipient or the employee or agent responsible for delivering
>>> the
>>> > message to the intended recipient, you are hereby notified that any
>>> > dissemination, distribution, or copying of this communication is strictly
>>> > prohibited. If you have received this communication in error, please
>>> > immediately notify us by replying to the original message at the listed
>>> > email address. Thank You.
>>> >
>>> > ----------------------------------------------------------------------
>>> > For LINUX-390 subscribe / signoff / archive access instructions,
>>> > send email to [email protected] with the message: INFO LINUX-390 or
>>> > visit
>>> > http://www.marist.edu/htbin/wlvindex?LINUX-390
>>> >
>>>
>>> ----------------------------------------------------------------------
>>> For LINUX-390 subscribe / signoff / archive access instructions,
>>> send email to [email protected] with the message: INFO LINUX-390 or
>>> visit
>>> http://www.marist.edu/htbin/wlvindex?LINUX-390
>>>
>>
>> ----------------------------------------------------------------------
>> For LINUX-390 subscribe / signoff / archive access instructions,
>> send email to [email protected] with the message: INFO LINUX-390 or
>> visit
>> http://www.marist.edu/htbin/wlvindex?LINUX-390
>
> ----------------------------------------------------------------------
> For LINUX-390 subscribe / signoff / archive access instructions,
> send email to [email protected] with the message: INFO LINUX-390 or
> visit
> http://www.marist.edu/htbin/wlvindex?LINUX-390
>
> NOTICE:
> This e-mail is intended solely for the use of the individual to whom it is
> addressed and may contain information that is privileged, confidential or
> otherwise exempt from disclosure. If the reader of this e-mail is not the
> intended recipient or the employee or agent responsible for delivering the
> message to the intended recipient, you are hereby notified that any
> dissemination, distribution, or copying of this communication is strictly
> prohibited. If you have received this communication in error, please
> immediately notify us by replying to the original message at the listed email
> address. Thank You.
>
> ----------------------------------------------------------------------
> For LINUX-390 subscribe / signoff / archive access instructions,
> send email to [email protected] with the message: INFO LINUX-390 or
> visit
> http://www.marist.edu/htbin/wlvindex?LINUX-390

----------------------------------------------------------------------
For LINUX-390 subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390

NOTICE:
This e-mail is intended solely for the use of the individual to whom it is 
addressed and may contain information that is privileged, confidential or 
otherwise exempt from disclosure. If the reader of this e-mail is not the 
intended recipient or the employee or agent responsible for delivering the 
message to the intended recipient, you are hereby notified that any 
dissemination, distribution, or copying of this communication is strictly 
prohibited. If you have received this communication in error, please 
immediately notify us by replying to the original message at the listed email 
address. Thank You.

----------------------------------------------------------------------
For LINUX-390 subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390

Reply via email to