From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13087 invoked by uid 1002); 4 May 2003 04:25:42 -0000 Mailing-List: contact gentoo-dev-help@gentoo.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@gentoo.org Received: (qmail 21092 invoked from network); 4 May 2003 04:25:40 -0000 Date: Sun, 4 May 2003 01:20:44 +1200 From: "leon j. breedt" To: Wouter van Kleunen Cc: gentoo-dev@gentoo.org Message-ID: <20030503132044.GA7084@noa.mshome.net> References: <000901c310f5$3c1d7020$4b00a8c0@valhalla> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; x-action=pgp-signed Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.4i Subject: Re: [gentoo-dev] Init replacement X-Archives-Salt: 538f639c-826b-4772-ae34-fdd5ab380264 X-Archives-Hash: 60a8273c0d49842796d8c73f2ebb537f -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Sat, May 03, 2003 at 11:08:55AM +0200, Wouter van Kleunen wrote: > Yes. I have thought of adding a script-service. But i removed it, because > i do not like scripts. I agree that they are convenient for executing a > collection of commands, but bash is a very weak programming language. well, you don't really need a programming language for init scripts themselves, conceptually you're not doing anything complex enough in them to warrant it. especially not if you have a compiled program doing all the calculations requiring data structures. for execution of commands, manipulating files quickly, and all the kinds of housekeeping things you typically want to do to start a "difficult" daemon, something which cannot be neatly done with a one line command like start-stop-daemon, a shell script is actually the most suitable solution, in my opinion. i really would not recommend requiring that it be an actual programming language, that would really limit adoption of your program to a far too small audience... how i planned to implement my version, was to have a file /etc/svc.d/, which described the service. in this file, you would declare dependencies, security attributes, etc. and also specify the command to start and to stop the service, which could refer to seperate scripts or just be oneliner commands. something like: start: /usr/sbin/exim -q15m -bd or script: exim where the first would start the daemon, and to stop it, send a KILL signal (implied by a missing stop: keyword). and the second would expect the script (located in /etc/svc.d/scripts) to accept 'start' or 'stop' arguments. a symlink in /etc/init.d/ => /sbin/svc would emulate the current behaviour of init scripts by running as if you'd executed 'svc ', where would be the argument you supplied when executing it. there will always be daemons which require more care and feeding than well-behaved ones, at some point to handle these you're going to have to allow execution of scripts, or reinvent your own scripting language again :) another thing which i think may be useful, include or exclude at your discretion, is to allow execution of scripts on entering/exiting a profile (or runlevel as sysvinit calls it). for example, if i drop down to single user profile, maybe i have some commands i want to execute before the shell appears. just some ideas... leon - -- in the beginning, was the code. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE+s8IsRWcl5mzp4f4RAgpLAJsFL+W/JZYRdHUBp6DJ36o6IBX5pQCfUzvM dZjX/0Gzge4Dp93aH2Ne36A= =Cx6r -----END PGP SIGNATURE----- -- gentoo-dev@gentoo.org mailing list