Skip site navigation (1)Skip section navigation (2)
Date:      04 Apr 2001 05:51:03 +0200
From:      Cyrille Lefevre <clefevre-lists@noos.fr>
To:        "David O'Brien" <arch@FreeBSD.ORG>
Cc:        Cy Schubert - ITSD Open Systems Group <Cy.Schubert@uumail.gov.bc.ca>, Jack Rusher <jar@integratus.com>, Neil Blakey-Milner <nbm@mithrandr.moria.org>, Michael Lucas <mwlucas@blackhelicopters.org>, "litos2001@libero.it" <litos2001@libero.it>
Subject:   Re: Startup scripts a la NetBSD
Message-ID:  <ofuds4pk.fsf@gits.dyndns.org>
In-Reply-To: <20010330115252.A93566@dragon.nuxi.com>
References:  <3AC4B808.9EB5806B@integratus.com> <200103301810.f2UIAGK06787@cwsys.cwsent.com> <20010330115252.A93566@dragon.nuxi.com>

next in thread | previous in thread | raw e-mail | index | archive | help
--=-=-=

"David O'Brien" <arch@FreeBSD.ORG> writes:

> On Fri, Mar 30, 2001 at 10:09:39AM -0800, Cy Schubert - ITSD Open Systems Group wrote:
> > Becoming more SYSV-like is not something most people in FreeBSD are 
> > enamoured with.  Hence I don't think it would be possible to implement 
> > all the changes I would like to see.
> 
> Correct.  Make that HELL NO WE WON'T GO SVR4!!!
> 
> The BSD init + NetBSD granular rc files is a nice compromise.  And thus
> why I am pushing a move in that direction.

some times ago, I've setup a NetBSD box and they init files are not yet
perfect. as I remember me, you couldn't do something like
/etc/rc.d/nfs.server start (or whatever) while nfs.server depends on
something else. you only could do /etc/rc which start all things.

also, I don't remember if they are checking if the service is already
started as HP-UX does.

in the same time (`ls -ld /etc/init.d` = Nov 23 :), I've began
something like in attachement which allow us to start/stop all
dependencies as I remember me. at least the nfs stack is working since
I use it when I need it. of course, this was an experiment and need to
be enhanced/reworked.

the basic idea was it have a generic wrapper which source its
configuration file a la HP-UX. the configuration file would be
something like this (from nfs.server) :

service_class=
service_instance=nfs_server
service_enable=YES
service_proc=nfsd
service_path=/sbin
service_program=$service_path/$service_proc
service_flags=

nfsd_pre_start () {
        case ${nfs_reserved_port_only} in
        [Yy][Ee][Ss])
                echo -n ' NFS on reserved port only=YES'
                sysctl -w vfs.nfs.nfs_privport=1 >/dev/null
                ;;
        esac
}
nfsd_post_start () {
        if [ -n "${nfs_bufpackets}" ]; then
                sysctl -w vfs.nfs.bufpackets=${nfs_bufpackets} >/dev/null
        fi
}

service_pre_start=nfsd_pre_start
service_pre_start_depend="portmap mountd"
service_post_start=nfsd_post_start
service_post_start_depend="lockd statd"
service_pre_stop=
service_pre_stop_depend=$service_post_start_depend
service_force_stop=true
service_post_stop=
service_post_stop_depend=mountd

and the wrapper is all the rest. this isn't currently done in the
attached samples.


--=-=-=
Content-Type: application/octet-stream
Content-Disposition: attachment; filename=init.d.tgz
Content-Transfer-Encoding: base64
Content-Description: init.d.tgz

H4sIAEOYyjoCA+1dW2/bxhL2q/grprRgNW0kkbqiCRigDylQFCgOTh4OisRHWZFLiTBNsrxY
cR39984u7xdZLmLHjjsD2Ja5s7OzuzOz83HJleM58cganzwkwUxbzudwAoK0xt/sH1hOtKW2
mC41HUDXpnPtBOYnX4GSKGYhwEno+/FtfLst5+7JsyMnnX/PjkYRD694+ABt6Nqt8z+fThfp
/C8mi/lSzP9kri1PQKP5f3A6/W68drxxtFWUU/jVhnjLQw5OBAw2rr9mLkTXUcwvwfQ929kk
IYsd3wPbcflLiBLzApwYHG+knCqODe9hGMKYx+bY4jZL3Dgah+ZIVIXz10K2p+QuP+rmK8oj
PwlNvgrNlbgcKdytyT8iNpdmO4oi7NpBUZYTGrIwtXks86wg9E34/gXcKL3AsSLjY4A9Nz/B
Z2C7C1B//+8b/exs3M9FCPaxOrgJQseLoa/vBx+VHirlgdoX9VU4V/Zli6bLosgo/nU8tDXP
5Ab2Z5V6W1HGPbZ2ufHH23dKtTHBapVXWLw1xhFOWJVpE7JLo1/lqStc8Nou26A6ipCJJXwl
TD/Oum+yiEP/RqgWcqkc8vhhvPI993qPU4wd/eP6/P1bfv7+XXT+Qun1uLn1Rd8H8Psv7wCt
Iq8Ioi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IRaaNOhnydHvySj1OIwxPlEzBQivH/KG3PhcV8Pp1/VLFTqvwIFveucc7BDv1L
YPgZBxX/VNsu7k0U05LNhkD1xQzZiWeKcIb+EF+/hEI3dY1o3q7rxzAsijwi9dHMUiRzrwc/
IxsqlPlhylwBKK2Zbp5rn+GkgsH1NxvUur2ljoFpMHjRHsOsQvvYfY/HI0f+Ckb2boSJytqP
+C0H73fcGWhbKG3A062Ab/JWQLnIb5JilW+s72dn3437fVzmxQdkGOfL/UQs93Q3ge4m0N0E
uptAdxOIvv39f/nVQo92/s90Vu7/Tyfy/J8J7f/T/v/zf/5b+t3xk4ACc1TnvM9vAojZP3wI
vBMcNsQQMiRkSJvEBOsI1hGsI1j3dGFdlv/LLxh9Cvn/QkvP/9To+78o/3/++b/0uzvl/3XO
e8z/peAvz/8bYij/p/yf8n/K/yn/p/yf8n/a1iEiIiIiIiIiIiIiIiIiIiIiIiIiIiIi+nr0
N+RzvHgAoAAA

--=-=-=


Cyrille.
--
home: mailto:clefevre@poboxes.com   UNIX is user-friendly; it's just particular
work: mailto:Cyrille.Lefevre@edf.fr   about who it chooses to be friends with.

--=-=-=--

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message




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