1828631 Members
8291 Online
109983 Solutions
New Discussion

echo during the startup

 
Gemini_2
Regular Advisor

echo during the startup

HI

I have a startup script S100test, I put a few "echo" statements. when I reboot the machine, it does NOT echo anything.

When system is stable, I can run it and it echoes....

did I miss anything?


7 REPLIES 7
RAC_1
Honored Contributor

Re: echo during the startup

When you reboot, you need to have kill script then (K*). Scripts starting with S8 are to be executed while system is coming up.

Am I missing something?
There is no substitute to HARDWORK
Patrick Wallek
Honored Contributor

Re: echo during the startup

Check /etc/rc.log for output from your startup/shutdown scripts.
Warren_9
Honored Contributor

Re: echo during the startup

hi,

is there any message in /etc/rc.log?

GOOD LUCK!!
Enrico P.
Honored Contributor

Re: echo during the startup

Hi,
by man rc:

Script Output
To ensure proper reporting of startup events, startup scripts are
required to comply with the following guidelines for script output.

+ Status messages, such as

starting house daemon

must be directed to stdout. All error messages must be
directed to stderr.

+ Script output, both stdout and stderr, is redirected to log
file /etc/rc.log, unless the startup checklist mode is set to
the raw mode. In this case, all output goes to the console.
All error messages should be echoed to stdout or stderr.

+ Startup scripts are not allowed to send messages directly to
the console, or to start any daemons that immediately write to
the console. This restriction exists because these scripts
are now started by the /sbin/rc checklist wrapper. All script
output should go to either stdout or stderr, and thus be
captured in a log file. Any console output will be garbled.

+ When a startup script returns an exit code of 3, /sbin/rc can
display a specific message on the console prior to rebooting
the system. This is achieved by creating a text file named
/etc/rc.bootmsg containing the text to be displayed to the
console. Note that /sbin/rc deletes this file after
displaying the message, so startup scripts need to write this
file each time a specific message is required to be displayed
on console prior to reboot.

Enrico
rariasn
Honored Contributor

Re: echo during the startup

Hi Gemini,


# cp -p S100test /sbin/init.d/test
# rm S100test
# ln -s /sbin/init.d/test ./S100test

rgs,

ran




Gemini_2
Regular Advisor

Re: echo during the startup

I checked, but there is no rc.log.

it is a bash script, the script looks like this

#!/bin/bash

echo please answer your answer
read a
echo $a


(of course, it does more than that, but the above is the trouble I am encountering)

I know the script was invoked, but I saw
S100test get started, but it didnt output the echo statement nor asked me any question.

if output goes to rc.log (didnt see that file), how can I re-direct the output and input?
Patrick Wallek
Honored Contributor

Re: echo during the startup

If this is HP-UX, then you should definitely have a file in the /etc/ directory called rc.log.

As to trying to get a startup script to ask for input when the machine is starting --- That is a VERY BAD idea in my opinion. Why? Because you want the machine to boot as quickly as possible. If it crashes in the middle of the night, there is the possiblity that the machine would be sitting and waiting on input from you for several hours causing it to not finish booting.

In my opinion you need to seriously rethink the use of a startup script that requires sys admin input.