From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31372 invoked by uid 1002); 2 May 2003 13:57:44 -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 22312 invoked from network); 2 May 2003 13:57:44 -0000 To: References: X-URL: http://terje.kvernes.no/ Organization: do you Gentoo? From: Terje Kvernes Date: 02 May 2003 15:57:42 +0200 In-Reply-To: Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: Terje Kvernes Subject: Re: [gentoo-dev] Init replacement X-Archives-Salt: e67e3589-08cd-4d1b-a9ee-9a98b5d86ec4 X-Archives-Hash: 5a03bd5b7dffeb5b0748a876e44b94c5 Wouter van Kleunen writes: > On 2 May 2003, Terje Kvernes wrote: > > > converting init-scripts to XML is a scary process. init-scripts > > should IMHO be human readable, as atomic as possible, and testable > > without depending on much more than having a generic shell. in > > addition to verboseness and lack of readability, XML makes it > > "interesting" to integrate more complex scripts, like autofs. > > > > yes, XML is easier to generate for a machine, but you generally > > don't generate init-scripts, if you do you probably build them > > from templates, which aren't XML friendly either. > > local res="$(cat /proc/modules | egrep 'serial' | cut -f1 -d" ")" > > remaining="$(cat /proc/mounts | awk `( print $3 " " $2 )'| \ > grep -E ^'code|nfs|ncpfs|smbfs' | awk '( print $2 | '| sort -r)" > > human readable, i see... hmmmm it's readable, yes. > how can you test something like this? by running it bit by bit on the command line, and testing each command. of course, you can clean up stuff like the above as well to make it more readable. then again, how would you achieve the same as what the script does without doing just the same thing? > it will break very easily. not really. there are reasons why one doesn't change the format of proc mounts. it looks complex, and it is, but it's also very much tried and true. one could argue about the lack of 'trap' or something similar tools in the scripts though. > and writing a init script for a daemon is very simple with my > system. Not all daemons have an ready to run gentoo init script you > know. and a lot of scripts require a great deal of "magic" before they run. why do you think the initscript for autofs looks the way it does? because start-stop-daemon automount works? :-) -- Terje -- gentoo-dev@gentoo.org mailing list