Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Startup Scripts fail to execute

Status
Not open for further replies.

InfoStorm

Technical User
Jun 11, 2009
3
US
Backgrouns of Issue: 3rd part database software must printer to serial device but the SCO 5 server only has networ printers. We get around this by writing a script that redirect all data going to the "/dev/printer" device and sent it to the network printer. For this to work, the scripts that redirect the data must be running in memory.

We cannot get these script to start at boot.
Methods tries:
Put scripts into the /etc/rc2.d directory (S99printer for example) to start at boot. They do not start.
Put scripts in /etc/rc.d/8 directory (another location where scripts of any name are supposed to start at boot. They do not start.

Added the scripts to the inittab:
printer2:234:respawn:/usr/lib/Printerscript &
Scripts failed to start.

The scripts are all "744 root sys" for permissions.

Any thoughts on the reason of their failure, how to get them to start, or where logs w/ error messages could be?
 
Do they start OK from a regular shell? Can you share the contents of the script? It might be that the script is not able to find some other component within the script itself (such as missing part of a PATH or other environment variable).
There is a sub-directory under /etc/rc2.d that might have some clues. I think it's called "message" or "messages".

Also, you can have your script write to its own log file so you can tell if it starts to run.

"Proof that there is intelligent life in Oregon. Well, Life anyway.
 
Scripts are simple:

while true
do
cat /dev/printer | lp -d PRINTER
end


Yes, the scripts run w/o problem from the console.

I tried editing the script to:

/bin/cat /dev/printer | /usr/bin/lp -d PRINTER

to remove any need at all for pathing.

Checked /etc/rc2.d/messages/S99printer.log file
Contains no information on why the script was terminating or failing to start, just results from when it was successfully running.


 
I highly doubt the script you posted run w/o problem from the console:
Code:
while true
do
cat /dev/printer | lp -d PRINTER
[!]done[/!]

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
The script has "DONE", I just typo'd in the example above.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top