Editing inittab?

M.BAKER mrb1 at homxc.ATT.COM
Thu Apr 6 23:06:20 AEST 1989


In article <1166 at westmark.UUCP>, dave at westmark.UUCP (Dave Levenson) writes:
> .................... 
> When is it ever safe to edit /etc/inittab when UNIX is running?
> The init(1) program reads this file whenever it is told to by
> telinit or init Q.  It also reads this file whenever one of its
> children dies.
> ................... 

I wondered about this too, but used to just go and edit /etc/inittab
on a "live" system anyhow (UNIX System V/386/3.2 on a 6386(E)).  No-
thing bad seemed to happen [perhaps they have some kind of
file locking mechanism during the change], but....

After the kernel was rebuilt (following a tunable parameter change,
installing a new/revised driver, etc.) things just didn't seem
right.  /etc/getty's weren't there anymore, and so on.  Then I
realized that /etc/inittab was being rebuilt each time by
appending /etc/conf/cf.d/init.base with any files in 
/etc/conf/init.d directory.  IDMKINIT(1M) gives full particulars
of this.  It also describes its use as a user-level command
to test new /etc/inittab versions before a real rebuild, along
with its use in shell scripts which need to change /etc/inittab
but do not reconfigure the kernel.

I would recommend making my changes in init.base, and the append
files in init.d directory, and then running IDMKINIT to produce
an intermediate version of the new /etc/inittab in /etc/conf/cf.d
directory.  Then you can copy it over the real /etc/inittab,
and init q.  This will make sure /etc/inittab is what you
want after a kernel rebuild, too.  Of course, stash the old
versions of all modified files away someplace safe, just in case :-)

Hope this helps, or at least is not "bad" advice.

M. Baker
homxc!mrb1



More information about the Comp.unix.questions mailing list