Starting processes automatically on bootup

Hello - We have setup printers to startup in the /etc/rc.d/8 directory and when the SCO system is booted this script should kick them off or start them up but it doesn't. So I have to start it from root and leave the window open. I know this isn't right and trying to figure out what's missing. In the /var/adm/rc2.log it shows:

/etc/rc.d/8/userdef: /dev/ttyr031: cannot open
/etc/rc.d/8/userdef: /dev/ttyr030: cannot open
/etc/rc.d/8/userdef: /dev/ttyr028: cannot open
/etc/rc.d/8/userdef: /dev/ttyr029: cannot open
/etc/rc.d/8/userdef: /dev/ttyr027: cannot open

Can someone tell me how to fix this?

Thank you!:slight_smile:

Not sure (have no experience with SCO) but it could be that your script is being started before the device driver has been loaded or before some other necessary component has been started. Try putting your script inside /etc/rc.d/rc.local, which is usually where post-startup scripts go. On most linux distributions and solaris, the scripts inside such a directory are numbered, S10network, S20http-server, etc., so that the OS runs them in order.

Hi - thanks for responding. I do not have the rc.local under /etc/rc.d; any other suggestions? Here's what I have:

drwxr-xr-x 2 root sys 512 Oct 22 1999 0
drwxr-xr-x 2 root sys 512 Oct 22 1999 1
drwxr-xr-x 2 root sys 512 Oct 22 1999 2
drwxr-xr-x 2 root sys 512 Oct 22 1999 3
drwxr-xr-x 2 root sys 512 Oct 22 1999 4
drwxr-xr-x 2 root sys 512 Oct 22 1999 5
drwxr-xr-x 2 root sys 512 Oct 22 1999 6
drwxr-xr-x 2 root sys 512 Oct 26 1999 7
drwxr-xr-x 2 root sys 512 Oct 8 10:21 8
drwxr-xr-x 2 root sys 512 Oct 22 1999 9

Does each correspond to an init level??

Yes; however I noticed that we had a few problems with the terminal settings and had to change a couple. I think 2 are not named correctly in the file. I will verify this again later today and make sure. Still if only 2 are wrong why didn't the other ones work? Right now, I have to start the file "userdef" in a root window and leave the window open after the system is rebooted. I know this is not right. This was orginally setup by one of our hardware vendors and when I brought it to his attention, he said he checked everything and does not know any reason why this won't work. So for now, I make sure daily this window does not close. The hardware vendor is still trying to figure this out as well. Hope you can help!

Thats because you executed the program in an interactive shell... You should in this case use

nohup <command/prog> &

Do those devices exist?

What is your init default (or runlevel)?
(who -r on most unix)

You should have a /etc/inittab, what is there?

. run-level 2 Oct 17 17:03 2 0 S

Here is the inittab:

bchk::sysinit:/etc/bcheckrc </dev/console >/dev/console 2>&1
ifor::sysinit:/etc/ifor_pmd </dev/null >/usr/adm/pmd.log 2>&1
tcb::sysinit:/etc/smmck </dev/console >/dev/console 2>&1
ck:234:bootwait:/etc/asktimerc </dev/console >/dev/console 2>&1
ack:234:wait:/etc/authckrc </dev/console >/dev/console 2>&1
is:S:initdefault:
r0:056:wait:/etc/rc0 1> /dev/console 2>&1 </dev/console
r1:1:wait:/etc/rc1 1> /dev/console 2>&1 </dev/console
r2:2:wait:/etc/rc2 1> /dev/console 2>&1 </dev/console
r3:3:wait:/etc/rc3 1> /dev/console 2>&1 </dev/console
sd:0:wait:/etc/uadmin 2 0 >/dev/console 2>&1 </dev/console
fw:5:wait:/etc/uadmin 2 2 >/dev/console 2>&1 </dev/console
rb:6:wait:/etc/uadmin 2 1 >/dev/console 2>&1 </dev/console
co:2345:respawn:/etc/getty tty01 sc_m
co1:1:respawn:/bin/sh -c "sleep 20; exec /etc/getty tty01 sc_m"
c02:234: off:/etc/getty tty02 sc_m
c03:234:respawn:/etc/getty tty03 sc_m
c04:234:respawn:/etc/getty tty04 sc_m
c05:234:respawn:/etc/getty tty05 sc_m
c06:234:respawn:/etc/getty tty06 sc_m
c07:234:respawn:/etc/getty tty07 sc_m
c08:234:respawn:/etc/getty tty08 sc_m
c09:234:respawn:/etc/getty tty09 sc_m
c10:234:respawn:/etc/getty tty10 sc_m
c11:234:respawn:/etc/getty tty11 sc_m
c12:234:respawn:/etc/getty tty12 sc_m
sdd:234:respawn:/tcb/files/no_luid/sdd
tcp::sysinit:/etc/tcp start < /dev/null > /dev/null 2>&1
Se1A:234: off:/etc/getty -t60 tty1A mhw
Se2a:234: off:/etc/getty tty2a m
Se2A:234: off:/etc/getty -t60 tty2A 3
Se1a:234:respawn:/etc/getty tty1a 2400
http::sysinit:/etc/scohttp start
scl: b: once:/etc/rc2.d/P86scologin start no_switch
sclb:2:bootwait:/etc/scologin init
r001:23:respawn:/etc/getty ttyr001 n
R001:23: off:/etc/getty ttyR001 19200
r002:23:respawn:/etc/getty ttyr002 n
R002:23: off:/etc/getty ttyR002 n
r003:23:respawn:/etc/getty ttyr003 n
R003:23: off:/etc/getty ttyR003 n
r004:23:respawn:/etc/getty ttyr004 n
R004:23: off:/etc/getty ttyR004 n
r005:23:respawn:/etc/getty ttyr005 n
R005:23: off:/etc/getty ttyR005 n
r006:23:respawn:/etc/getty ttyr006 n
R006:23: off:/etc/getty ttyR006 n
r007:23:respawn:/etc/getty ttyr007 n
R007:23: off:/etc/getty ttyR007 n
r008:23:respawn:/etc/getty ttyr008 n
R008:23: off:/etc/getty ttyR008 n
r009:23:respawn:/etc/getty ttyr009 n
R009:23: off:/etc/getty ttyR009 n
r010:23:respawn:/etc/getty ttyr010 n
R010:23: off:/etc/getty ttyR010 n
r011:23:respawn:/etc/getty ttyr011 n
R011:23: off:/etc/getty ttyR011 n
r012:23:respawn:/etc/getty ttyr012 n
R012:23: off:/etc/getty ttyR012 n
r013:23:respawn:/etc/getty ttyr013 n
R013:23: off:/etc/getty ttyR013 n
r014:23:respawn:/etc/getty ttyr014 n
R014:23: off:/etc/getty ttyR014 n
r015:23: off:/etc/getty ttyr015 n
R015:23: off:/etc/getty ttyR015 n
r016:23: off:/etc/getty ttyr016 n
R016:23: off:/etc/getty ttyR016 n
r017:23:respawn:/etc/getty ttyr017 19200
R017:23: off:/etc/getty ttyR017 19200
r018:23:respawn:/etc/getty ttyr018 19200
R018:23: off:/etc/getty ttyR018 19200
r019:23:respawn:/etc/getty ttyr019 19200
R019:23: off:/etc/getty ttyR019 19200
r020:23:respawn:/etc/getty ttyr020 19200
r021:23:respawn:/etc/getty ttyr021 19200
R021:23: off:/etc/getty ttyR021 19200
r022:23:respawn:/etc/getty ttyr022 19200
R022:23: off:/etc/getty ttyR022 19200
r023:23: off:/etc/getty ttyr023 19200
R023:23: off:/etc/getty ttyR023 19200
r024:23: off:/etc/getty ttyr024 19200
R024:23: off:/etc/getty ttyR024 19200
r025:23: off:/etc/getty ttyr025 19200
R025:23: off:/etc/getty ttyR025 19200
r026:23: off:/etc/getty ttyr026 19200
R026:23: off:/etc/getty ttyR026 19200
r027:23: off:/etc/getty ttyr027 19200
R027:23: off:/etc/getty ttyR027 19200
r028:23: off:/etc/getty ttyr028 19200
R028:23: off:/etc/getty ttyR028 19200
r029:23: off:/etc/getty ttyr029 19200
R029:23: off:/etc/getty ttyR029 19200
r030:23: off:/etc/getty ttyr030 n
R030:23: off:/etc/getty ttyR030 n
r031:23: off:/etc/getty ttyr031 k
R031:23: off:/etc/getty ttyR031 k
r032:23: off:/etc/getty ttyr032 xxx
R032:23: off:/etc/getty ttyR032 xxx
brlm: 234: once:/u/blmgr/BasisRunLM; # start BASIS License Manager
inittab: END

From what I see
You finish booting process at level 2...
So it doesnt make much sence to try at level 8, and I always thought it stopped at 4 (well 6...then the rest are very special options...)
If you want to change the level (like I do...) so that what you configured after standard OS install be launched, you must specify so in another file:
the DEFAULT_LEVEL entry in /etc/default/boot

But its ages since I last touched a SCO... and cant remember much...

Maybe this doc will help:
ftp://ftp.digi.com/support/techsupport/unix/sco_unix/scortty.html

Thank you! I found the /etc/default/boot which I will possibly change so that this level will boot. I am now looking at the other document as well. You've given me valuable information. I will most likely make the changes after hours tomorrow and see how things work. I'll let you know later. Thank you so much for all your information, help and tips.

Well, the /etc/default/boot file has the following:

DEFBOOTSTR=hd(40)unix swap=hd(41) dump=hd(41) root=hd(42)
AUTOBOOT=YES
FSCKFIX=YES
MULTIUSER=YES
PANICBOOT=NO
MAPKEY=YES
SERIAL8=NO
SLEEPTIME=0
BOOTMNT=RO
apm.connect=no

I don't know enough about this file and where to make the changes to include the boot levels. Can you explain or tell me anything from seeing what I listed?

There is a file in /etc/default/mapkey which shows:

# default/mapkey - monitor screen mapping: mapkey(M)
#
tty01
tty02
tty03
tty04
tty05
tty06
tty07
tty08
tty09
tty10
tty11
tty12

Not sure if this is related???

Read carefully the man pages:
http://docsrv.sco.com:507/en/man/html.M/init.M.html
http://docsrv.sco.com:507/en/man/html.F/inittab.F.html

All is there

I will add: the init level s,S is not referenced in inittab EXCEPT IN SCO UNIX,which is its default boot level... And so should not be modified...

in /etc/default/boot,you would add if it doesnt exist DEFAULT_LEVEL entry
If not present it take 2 as default...

Regards