From owner-freebsd-ports Fri Dec 21 6:49:59 2001 Delivered-To: freebsd-ports@freebsd.org Received: from zaphod.euronet.nl (zaphod.euronet.nl [194.134.128.241]) by hub.freebsd.org (Postfix) with ESMTP id 3461F37B417; Fri, 21 Dec 2001 06:49:53 -0800 (PST) Received: (from ernst@localhost) by zaphod.euronet.nl (8.11.6/8.11.6) id fBLEnsD68057; Fri, 21 Dec 2001 15:49:54 +0100 (CET) (envelope-from ernst) Message-Id: <200112211449.fBLEnsD68057@zaphod.euronet.nl> Content-Type: text/plain; charset="koi8-r" From: Ernst de Haan Organization: EuroNet Internet B.V. To: Maxim Sobolev Subject: Re: Starting a service after installation? Date: Fri, 21 Dec 2001 15:49:54 +0100 X-Mailer: KMail [version 1.3] Cc: Ernst de Haan , ports@FreeBSD.org References: <200112211144.fBLBif252175@zaphod.euronet.nl> <200112211311.fBLDBCt66721@zaphod.euronet.nl> <3C23397B.E9A1A197@FreeBSD.org> In-Reply-To: <3C23397B.E9A1A197@FreeBSD.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Okay, then what about a /etc/services.conf in combination with an /etc/defaults/services.conf ? Sounds like a valid approach to me. The only problem is that /etc/defaults/services.conf would have to be updated a lot. So perhaps we should put this file in below ${PORTSDIR} somewhere.... Any ideas? Ernst On Friday 21 December 2001 14:30, Maxim Sobolev wrote: > Ernst de Haan wrote: > > On Friday 21 December 2001 13:21, Maxim Sobolev wrote: > > > Ernst de Haan wrote: > > > > Hey all, > > > > > > > > How should services like an application server (i.e. www/orion or > > > > www/jakarta-tomcat) be started at boot time? > > > > > > > > I was thinking we could something like this, for example for > > > > www/orion: 1) During installation, install a script in > > > > ${PREFIX}/etc/rc.d. In this case orion.sh. Make it +x so it can be > > > > executed. The www/orion port (and a lot of other ports) already do > > > > this. > > > > 2) Make the script so that it checks if it should be started by > > > > reading /etc/rc.conf and /etc/defaults/rc.conf. For example, for > > > > www/orion, it could check for "start_orion". If this variable is not > > > > found, then the service is perhaps not started (or should it) ? If > > > > the variable *is* found then the service will only be started if the > > > > value matches [Yy][Ee][Ss] > > > > > > > > I'm also assuming that starting a service right after installation is > > > > a Bad Thing^TM. What about a 'make run' ? ;`/ > > > > > > Usually FreeBSD ports use different strategy. The service installs > > > startup script into /usr/local/etc/rc.d, in the case when the service > > > > Yes, this is what I described in (1). But I would like to *extend* the > > current approach. What if I installed a port like Orion, but I *don't* > > want it to be started at system startup? In my suggestion you would add: > > > > start_orion="NO" > > > > to your /etc/rc.conf file. > > > > > startup script into /usr/local/etc/rc.d, in the case when the service > > > is expected to be "on" right after installation this script is named > > > > "is expected to be "on"" ? What if the user installing the script would > > like the service to be off by default? Perhaps we should introduce a > > variable for this so one can do something like: > > > > make START_AT_BOOT=NO install > > > > whoch would in turn add something like > > > > start_="NO" > > > > to /etc/rc.conf... > > > > Just braindumping here ;) > > IMO /etc/rc.conf is only for the services in the base system, > configuration for optional packages should go elsewhere. > > -Maxim > > > Ernst > > > > > fooservice.sh, but when the service is to be disable by default - the > > > script is named fooservice.sh.sample. The script should take either > > > "start" or "stop" argument - the former automatically supplied by > > > /etc/rc.* during a machine startup, while the latter - during a > > > shutdown. You can find plenty of examples in the ports tree usable as > > > a template for such script. > > > > > > And I don't really think that you need something like `make run' > > > because it's not much easier than direct call to appropriate script. > > > Instead you could tweak the port to emit during post-install a message > > > saying that the user should run `${PREFIX}/etc/rc.d/fooservice start' > > > if he want to start the service right now. > > > > > > -Maxim -- Ernst de Haan EuroNet Internet B.V. "Come to me all who are weary and burdened and I will give you rest" -- Jesus Christ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message