Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 Sep 1995 23:27:44 -0500 (CDT)
From:      peter@taronga.com (Peter da Silva)
To:        terry@lambert.org (Terry Lambert)
Cc:        hackers@FreeBSD.ORG
Subject:   Re: ports startup scripts
Message-ID:  <199509260427.XAA28276@bonkers.taronga.com>
In-Reply-To: <199509251847.LAA05564@phaeton.artisoft.com> from "Terry Lambert" at Sep 25, 95 11:47:11 am

next in thread | previous in thread | raw e-mail | index | archive | help
> I'd suggest 3 digits rather than 2 as a guard
> against overflow, though I expect the lead digit to remain 0 for a long
> time (if not forever).

You mean "the trailing digit", right?

Let's look at all the things that a package (not just a /cdrom/packages/...
package, but any software component) needs to get right to install...

	1. periodic cleanup scripts.

		Cron does this pretty well, except that you need to give
		each package its own user-id.

	2. startup/shutdown scripts.

		The System V model does this quite well.

	3. tcp/ip port assignment.

		This one is sticky. It's safe to append to /etc/services,
			but not so safe to extract them.

	4. inetd-driven services.

		Same problem as /etc/services.

	5. user and group ids, for things like news.

		User-ids are hard to add. Group ids are harder. A
			tool to do this would be helpful.

	6. setting up spool directories.

		You don't want these to be under /usr/local.

	7. setting up syslog entries.

		See 3, 4, 5.

	8. documentation.

		This one we actually have under control for man pages.
			info files are more of a problem because you
			really want them to be hooked into the root.
			html can be handled by a directory of files
			or cgi-bin.

	9. device drivers

		System V had this working pretty well. BSD is relaly
			pretty horrible here. How do you add stuff to
			MAKEDEV? /sys/i386/conf/*?

	10. ... (/etc/daily???)

There's a couple of basic ways to address this. You can have one directory
per package, with specially named files in them (/var/db/pkg could be a
start for this), or you can have multiple directories with a file in each
named after the package... System V does that. It works pretty well for
each individual directory, but not overall.

Here's what I propose:

	For each package, create a directory under /etc/package.

	In this directory, you have the following files:

		startup.XXX
		shutdown.XXX
		crontab.userid
		makedev
		config
		passwd
		group
		ttys
		inetd.conf
		services
		syslog
		install
		remove

	There is also an /etc/package/_base.

	After installing a package you use these files (from /etc/package/*)
	to recreate:

		/etc/rc.local
		/etc/shutdown.local
		/var/cron/tabs/*
		/dev/MAKEDEV
		/sys/i386/conf/LINT
		/sys/i386/conf/GENERIC
		/etc/passwd (for uid<1000)
		/etc/passwd.master (for uid<1000)
		/etc/group
		/etc/ttys
		/etc/inetd.conf
		/etc/syslog.conf
		/etc/services

	This lets the BSD people use the files they're familiar with, but
	the files the system uses are secondary... they're rebuilt from
	packages.

	As an optimization, you can compare the date of the files to the
	dates of the /etc/package/* files, and only recreate them if there
	are newer files (this can be easily done with an automatically
	generated makefile).

	Most packages don't add user-ids. That's good, because recrunching
	the password index file can be expensive.

This would work better than the current scheme, and better than
System V, and doesn't need symlinks. *And* the existing package scheme
works with it...



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199509260427.XAA28276>