[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: rc

# What structure will these 'makefiles' have?
# I think it would be very practical to be able effectively
# change them using "automatic" scripting if we want this
# kind of init to be widely used by package managers.

This was a thought I had not longer after my last post.

It goes without saying that they should be plain-text, with a very
well-defined (and simple) format. My basic thinking was to have..

/etc/init.conf             The effective replacement for /etc/inittab
/etc/rc.d/*.initrc         Descriptions for each package
/etc/libexec/init.d/*      Default location for scripts

The format being:

[runlevel:]<identifier>[.<action>] <keyword> [<identifier>[.<action>]]


-- /etc/init.conf:

runlevel:graphical requires X
runlevel:graphical requires xfs

-- /etc/rc.d/xfs.initrc:

# Don't allow shutdown if X is running

xfs.stop requires X.stop

-- /etc/rc.d/X.initrc:

# Ensure that we always start before gpm, if the two will be started at
# the same runlevel

X.start before gpm.start

# We need xfs in order to start up

X requires xfs

# We don't allow 'reload' - it's meaningless for this

X.reload disable

# Override the default /libexec/init.d/* commands
# We don't need to specify a command for 'restart', as
# init will automagically do a 'stop' and then 'start' if not
# overriden.

X.start command /usr/X11R6/bin/xdm --nodaemon
X.stop command killproc xdm

So..a package manager's install script would do something along the lines

- Install /etc/rc.d/PACKAGE.initrc
- Install /libexec/init.d/PACKAGE, if apt.
- Add dependencies to /etc/init.conf, if apt.
- Run 'init --reload' to ensure information is updated  (or something

This is what I was thinking of, anyway. I need to sit down and think about
exactly what the available keywords would be and so on, and I'm sure
there'll be plenty of discussion about how crappy my config files are
(just so long as people say it *now* and not in 3 month's time when I've
done a nice library interface to them, I'm happy :>)


Mo McKinlay             Chief Software Architect          inter/open Labs
GnuPG Key: pub  1024D/76A275F9 2000-07-22 Mo McKinlay <mmckinlay@gnu.org>

Reply to: