From owner-freebsd-questions@FreeBSD.ORG Wed Mar 14 10:35:18 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 79CA3106566C for ; Wed, 14 Mar 2012 10:35:18 +0000 (UTC) (envelope-from freebsd-questions@herveybayaustralia.com.au) Received: from mail.unitedinsong.com.au (mail.unitedinsong.com.au [150.101.178.33]) by mx1.freebsd.org (Postfix) with ESMTP id 26E0F8FC08 for ; Wed, 14 Mar 2012 10:35:17 +0000 (UTC) Received: from mail.unitedinsong.com.au (bell.herveybayaustralia.com.au [192.168.0.40]) by mail.unitedinsong.com.au (Postfix) with ESMTP id E6A055C28 for ; Wed, 14 Mar 2012 20:48:48 +1000 (EST) Received: from laptop1.herveybayaustralia.com.au (laptop1.herveybayaustralia.com.au [192.168.0.177]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mail.unitedinsong.com.au (Postfix) with ESMTPSA id B77AD5C22 for ; Wed, 14 Mar 2012 20:48:48 +1000 (EST) Message-ID: <4F607327.7010209@herveybayaustralia.com.au> Date: Wed, 14 Mar 2012 20:29:59 +1000 From: Da Rock User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:7.0.1) Gecko/20111109 Thunderbird/7.0.1 MIME-Version: 1.0 To: freebsd-questions@freebsd.org References: <4F605307.8070907@infracaninophile.co.uk> In-Reply-To: <4F605307.8070907@infracaninophile.co.uk> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: start at boot, run as non-root X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd-questions@freebsd.org List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Mar 2012 10:35:18 -0000 On 03/14/12 18:12, Matthew Seaman wrote: > On 14/03/2012 07:30, n dhert wrote: >> I have FreeBSD8.2. >> Sedna, an XML database server, had no port in th FreeBSD ports collection >> but has a binary compiled for FreeBSD8 on www.sedna.org. >> I installed that. >> To start it at boot I created a script /usr/local/etc/rc.d/sedna : >> ----------------------------------------------- >> #!/bin/sh >> # >> # PROVIDE: sedna >> # REQUIRE: DAEMON >> # KEYWORD: shutdown >> # >> . /etc/rc.subr >> >> name="sedna" >> rcvar=${name}_enable >> command=/home/opt/sedna/bin/se_gov >> >> load_rc_config $name >> >> : ${sedna_enable="NO"} >> >> run_rc_command "$1" >> -------------------------------------------- >> and added sedna_enable="YES" at the end of my /etc/rc.conf >> >> This way it starts at boot: >> $ ps -jaxww | grep se_ >> root 7064 1 7064 7064 0 Is ?? 0:00.00 >> /home/opt/sedna/bin/se_gov -background-mode off -listen-address localhost >> -port-number 5050 -ping-port-number 5151 -el-level 3 -alive-timeout 0 >> -stack-depth 4000 >> The deamon runs as root. I want it run by a non-root user, e.g. a user >> 'sedna'' >> >> How can I do that? >> >> The sedna server binary se_gov has no option in its man-page to start the >> program run as a different user .. > Add a variable: > > ${name}_user=sedna > > to the init script. The rc(8) system will use su(1) to start up the > sedna process using your selected username. There's also ${name}_group > but that works a bit differently. > > I'm intrigued that this software should be supported on FreeBSD > upstream, but not appear in ports. Are there some onerous license terms > or other obstacles[*]? If not, would you consider submitting your work > as a port? > > Cheers, > > Matthew > > [*] Seems it uses Apache licensing according to http://www.sedna.org/, > which is exceedingly FreeBSD compatible, so I don't think licensing > would be an obstacle. That would not be the problem, as the ports system can handle more licenses than simply bsd compatible; Its merely recommended. To illustrate, there are eval and commercial products in the ports tree. You have to register and pay the organisation when you install and start using (like komodo, others). The port is to ease installation on FreeBSD an app that would be widely used.