[comp.unix.i386] inittab action entries under ISC 386/ix

alan@dialogic.UUCP (Alan Murphy) (10/04/89)

Hi,
 I am developing device drivers under ISC 386/ix 3.2 and I
need to be able to create an inittab entry at build time. I
thought I could use the action word bootwait (basically the
operation involves downloading code to a controller at power up
time). However, on the first system reboot after rebuilding the
kernel, my inittab entry is not acted upon (I suspect that init
examines the old inittab first and subsequently rebuilds inittab
using the new information). All subsequent reboots work fine. Can
someone confirm my suspicion? Has anyone had similar experiences?
Any help appreciated.

 Thanks
Alan Murphy. Dialogic Corp.
 

cpcahil@virtech.UUCP (Conor P. Cahill) (10/05/89)

In article <965@dialogic.UUCP>, alan@dialogic.UUCP (Alan Murphy) writes:
>  I am developing device drivers under ISC 386/ix 3.2 and I
> need to be able to create an inittab entry at build time. I
> thought I could use the action word bootwait (basically the
> operation involves downloading code to a controller at power up
> time). However, on the first system reboot after rebuilding the
> kernel, my inittab entry is not acted upon (I suspect that init
> examines the old inittab first and subsequently rebuilds inittab
> using the new information). All subsequent reboots work fine. Can
> someone confirm my suspicion? Has anyone had similar experiences?

Instead of modifying the inittab table to add a bootwait entry, you 
should add a small shell to the rc?.d directory (suggest rc2.d) which
will download the controller.  Naming the file apropriately will allow
you to control when your controller is downloaded when compared to the 
other rc2.d startup scripts.

A good side effect of this is that if the driver is causing the 
kernel to panic, you can boot to single user mode without running into
your download code (or if you boot your old reliable version of /unix
because the new one doesn't work, you won't have problems with an 
attemp to download the controller).

BTW the inittab file is rebuilt as the system goes from single user
mode to multi user mode.
-- 
+-----------------------------------------------------------------------+
| Conor P. Cahill     uunet!virtech!cpcahil      	703-430-9247	!
| Virtual Technologies Inc.,    P. O. Box 876,   Sterling, VA 22170     |
+-----------------------------------------------------------------------+

johnl@esegue.segue.boston.ma.us (John R. Levine) (10/05/89)

In article <965@dialogic.UUCP> alan@dialogic.UUCP (Alan Murphy) writes:
>Hi,
> I am developing device drivers under ISC 386/ix 3.2 and I
>need to be able to create an inittab entry at build time. ...
>(basically the operation involves downloading code to a controller at
>power up time). ...

It's a lot easier to put your startup commands in a file in /etc/init.d
and link them into /etc/rc2.d, like all of the other startup commands.
That's the standard way to run initialization scripts and it's a lot less
fragile than fooling with inittab.
-- 
John R. Levine, Segue Software, POB 349, Cambridge MA 02238, +1 617 492 3869
johnl@esegue.segue.boston.ma.us, {ima|lotus}!esegue!johnl, Levine@YALE.edu
Massachusetts has 64 licensed drivers who are over 100 years old.  -The Globe

kdg@nirvo.uucp (Kurt Gollhardt) (10/12/89)

>In article <965@dialogic.UUCP> alan@dialogic.UUCP (Alan Murphy) writes:
>>Hi,
>> I am developing device drivers under ISC 386/ix 3.2 and I
>>need to be able to create an inittab entry at build time. ...
>>(basically the operation involves downloading code to a controller at
>>power up time). ...

You *can* create rc2.d entries, as suggested by others, but if you *do*
want an inittab entry instead, the way to do it is to create a file
named /etc/init.d/foo, where foo is the name of your driver module.  The
system constructs /etc/inittab by concatenating /etc/conf/cf.d/init.base
with /etc/init.d/*.

Actually, you're probably building this as an installable package (with
Driver.o, Sdevice, etc. files for your driver).  In this case, you would
just make a file named "Init" at the top level of your tree, and this
will be installed as /etc/conf/init.d/foo.

Note: the lines in /etc/conf/init.d/foo have a slightly different format
than /etc/inittab.  Whereas inittab is:

	id:rstate:action:process

/etc/conf/init.d/foo is:

	action:process

or

	rstate:action:process

The 'id' is automatically generated, and the default rstate is '2'.

Also, if you want an rc script instead of an inittab line, the "correct"
way to do this is by putting in a file named "Rc", which gets installed
as /etc/idrc.d/foo, and is automatically invoked upon entering init level 2.
(Note: when creating this module, the file permissions must allow execution
by root.)  The counterpart to this for system shutdown is the "Shutdown"
file - installed automatically as /etc/idsd.d/foo.

[This information is detailed in the UNIX System V/386 Release 3.2
Integrated Software Development Guide and its ISC equivalent.]

-- 
Kurt Gollhardt                      \   Nirvonics, Inc. -- Plainfield, NJ
Kurt.Gollhardt@nirvo.uucp           /\     Software Design and Consulting
...!rutgers!nirvo!Kurt.Gollhardt   /  \
     "It's all about people; not you and me or him and her, but *us*."