From owner-freebsd-hackers Mon Sep 25 21:50:35 1995 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id VAA11321 for hackers-outgoing; Mon, 25 Sep 1995 21:50:35 -0700 Received: from UUCP-GW.CC.UH.EDU (root@UUCP-GW.CC.UH.EDU [129.7.1.11]) by freefall.freebsd.org (8.6.12/8.6.6) with SMTP id VAA11313 for ; Mon, 25 Sep 1995 21:50:32 -0700 Received: from Taronga.COM by UUCP-GW.CC.UH.EDU with UUCP id AA19730 (5.67a/IDA-1.5); Mon, 25 Sep 1995 23:42:11 -0500 Received: (from peter@localhost) by bonkers.taronga.com (8.6.11/8.6.9) id XAA28276; Mon, 25 Sep 1995 23:27:45 -0500 From: peter@taronga.com (Peter da Silva) Message-Id: <199509260427.XAA28276@bonkers.taronga.com> Subject: Re: ports startup scripts To: terry@lambert.org (Terry Lambert) Date: Mon, 25 Sep 1995 23:27:44 -0500 (CDT) Cc: hackers@FreeBSD.ORG In-Reply-To: <199509251847.LAA05564@phaeton.artisoft.com> from "Terry Lambert" at Sep 25, 95 11:47:11 am X-Mailer: ELM [version 2.4 PL24] Content-Type: text Content-Length: 3035 Sender: owner-hackers@FreeBSD.ORG Precedence: bulk > 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...