Operating System - HP-UX
1846999 Members
3160 Online
110257 Solutions
New Discussion

Re: boot script denomination

 
Simon,Tamás
Occasional Contributor

boot script denomination

Hi everyone!
I ask for help. I have written a script to boot
procedure. This script starts after S100nfs.server during the boot and works well.
I'd like know wich file contains the denomination of this script appeared in the console during boot.
Now on the console I can see .......[OK]
What method me must apply to appear the text?
Thanks! Regards, Tamas S.
8 REPLIES 8
Sajid_1
Honored Contributor

Re: boot script denomination

You will get more details from these log files:
/etc/rc.log
/etc/rc.log.old

Also you can pipe the outputs of the scripts to a file.
learn unix ..
Sridhar Bhaskarla
Honored Contributor

Re: boot script denomination

Hi Tamas,

You should have two more case statements in your /sbin/init.d script - start_msg and stop_msg that prints the required message. Look at other files in /sbin/init.d/ for more details and syntax.

-Sri

You may be disappointed if you fail, but you are doomed if you don't try
RAC_1
Honored Contributor

Re: boot script denomination

Log of all RC scripts startup scripts is /etc/rc.log you can check there to know the status.
There is no substitute to HARDWORK
Tom Geudens
Honored Contributor

Re: boot script denomination

Hi,
You do this by two different entries in the start/stop script. Example :

...
case $1 in
'start_msg')
# Emit a _short_ message relating to running this script with
# the "start" argument; this message appears as part of the checklist.
echo "Starting the Enterprise ControlStation subsystem"
;;

'stop_msg')
# Emit a _short_ message relating to running this script with
# the "stop" argument; this message appears as part of the checklist.
echo "Stopping the Enterprise ControlStation subsystem"
;;

'start')
...

The entries 'start_msg' and 'stop_msg' contain those texts ...

Regards,
Tom
A life ? Cool ! Where can I download one of those from ?
harry d brown jr
Honored Contributor

Re: boot script denomination

Are you doing something like this:

case $1 in

start_msg)
echo "Start NFS server subsystem"
;;

stop_msg)
echo "Stop NFS server subsystem"
;;


start)



live free or die
harry
Live Free or Die
A. Clay Stephenson
Acclaimed Contributor

Re: boot script denomination

I think that I underderstand your question.

Use a text editor to examine any file in /sbin/init.d. You will notice that in addition to the traditional start) and stop) sections, HP-UX adds start_msg) and stop_msg) sections to the rcN.d files. If you add a start_msg) echo "Starting my stuff"
;;
to the case statement, you will see the prompt.

The best way to do this is to examine the file
/sbin/init.d/template.
If it ain't broke, I can fix that.
Shannon Petry
Honored Contributor

Re: boot script denomination

As someone else mentioned, your startup needs to be in a case statement, with at least 2 cases.
case $1 in
start_msg)
echo "Message on boot screen"
;;
start)
echo "this is the script to run"
;;
esac

Each script is called 2 times. First to build a table of start_messages from scripts, then actually running them. (script return code displayed as OK or FAIL)

Regards,
Shannon
Microsoft. When do you want a virus today?
James R. Ferguson
Acclaimed Contributor

Re: boot script denomination

Hi Simon:

You should start with '/sbin/init.d/template' *as* the skeletal template for your script. *Add* your code to it by following the instructions (comments) contained in the template file itself. The man pages for 'rc' also describe the basic model you should follow in order for your script to reflect its execution in '/etc/rc.log' and on the console checklist correctly. Pay close attention to the discussion of return codes too.

Regards!

...JRF...