From: "Mike Barker" Subject: rough doc for mkserv scripting Date: Sun, 25 Aug 1996 00:06:03 EDT Date: Wed Oct 2 13:52:33 EDT 1996 Basically, to add a mkserv service, you need to write at least two shell scripts (service.add and service.del). You may need to write two others for some services (service.sync and service.dep). In all cases, start by taking a "plain vanilla" installed system and doing a hand installation of your new service. As you do this, write down each step. That's the core of the service.add script. Then do a hand removal of your new service. Again, write down each step. That's the core of the service.del script. You can also attach mkserv and look at the existing scripts in /mit/mkserv/services. I believe you can use $LOGFILE in your scripts as an externally defined logging file for messages. -There are other variables you can use, as well as magic for editing -many config files, including rc.conf, inetd.conf, and passwd. Someone -needs to figure out all of these and document them. Service.add - this is the main file. Basically, this file is a shell script that does all the setup to make the service run on the system. It will probably involve some of these: test for repeat installs begin service update log (if you keep a log of the actions involved in doing the service update/add) make any needed directories copy any needed files (executable, data, man, etc.) make links modify configuration files add startup/shutdown files/commands close service update log (if you keep a log of the actions involved in doing the service update/add) tell user about status of update may provide a "quickstart" description to user (note that this may be run automatically too, so don't assume there is always a user hanging over the terminal!) Service.del - this file is intended to reverse or undo the effects of the add. In some cases this can be hard to do (e.g. removing startup commands from a file) but do the best you can. Test what happens when you undo the add, and test what happens when you undo twice. Service.sync - I think this is a list that can be added to /usr/athena/lib/update/services.sync when .private.sync forces mkserv to copy things local (as part of synctree processing). However, I have not used this, and am guessing from the contents of such in /mit/mkserv/services and the man page about mkserv. -/usr/athena/lib/update/services.sync doesn't exist. .private.sync is -machine specific, not mkserv service related, and most people are not -familar with it anyway. We should make some attempt to document the -syntax here. Service.dep - this appears to be a description of dependencies. I.e., if this service requires some other mkserv service be installed first, that dependency would be described in this file. -Again syntax should be defined, and making sure the dependee service -isn't already defined.