From owner-freebsd-ports@FreeBSD.ORG Thu Jan 7 09:51:56 2010 Return-Path: Delivered-To: ports@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B22D71065693; Thu, 7 Jan 2010 09:51:56 +0000 (UTC) (envelope-from jean-yves.boisiaud@osiell.com) Received: from teide.osiell.com (teide.osiell.com [88.191.93.173]) by mx1.freebsd.org (Postfix) with ESMTP id 7539B8FC16; Thu, 7 Jan 2010 09:51:56 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by teide.osiell.com (Postfix) with ESMTP id E50891E078; Thu, 7 Jan 2010 10:35:47 +0100 (CET) X-Virus-Scanned: amavisd-new at osiell.com Received: from teide.osiell.com ([127.0.0.1]) by localhost (teide.osiell.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8FZuKOSDx2a4; Thu, 7 Jan 2010 10:35:46 +0100 (CET) Received: from [172.24.1.181] (etna.osiell.com [88.177.53.106]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by teide.osiell.com (Postfix) with ESMTPSA id 877441E072; Thu, 7 Jan 2010 10:35:46 +0100 (CET) Message-ID: <4B45AAF5.50905@osiell.com> Date: Thu, 07 Jan 2010 10:35:49 +0100 From: Jean-Yves Boisiaud - Osiell User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: wen@FreeBSD.org Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Cc: ports@FreeBSD.org Subject: FreeBSD Port: openerp-server-5.0.6_1 X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2010 09:51:56 -0000 Hello, Here is a rc.d script to start/stop/restart the OpenERP server. openerp-server default configuration file (-c option) should give the same PID file that the rc script : pidfile = /var/run/openerp/server.pid The installation script should create a user with no password used to run the OpenERP server. Here, I used terp. <<<<<<<<<<<<<<<<<<<<< #!/bin/sh # # PROVIDE: openerp_server # REQUIRE: postgresql # KEYWORD: shutdown # # Add the following line to /etc/rc.conf to enable OpenERP server: # # openerp_server_enable="YES" # # optional # openerp_server_flags="-c /usr/local/etc/openerp-server.conf" # openerp_server_user="terp" # # Do not forget to define the same PID file in the OpenERP configuration # file (see the variable $pidfile defined below). # # This scripts takes one of the following commands: # # start stop restart status # : ${openerp_server_enable="NO"} : ${openerp_server_flags="-c /usr/local/etc/openerp-server.conf"} : ${openerp_server_user="terp"} . /etc/rc.subr name="openerp_server" rcvar=${name}_enable command_args=" >/dev/null 2>&1 &" pidfile="/var/run/openerp/server.pid" start_precmd="${name}_prestart" command=/usr/local/bin/openerp-server procname=/usr/local/bin/python2.6 openerp_server_prestart() { # PID file should be not empty. [ x"$pidfile" = x ] && err 1 "variable pidfile should not be empty" # Check PID directory exists. d=$(dirname "$pidfile") if [ ! -d "$d" ]; then # Create PID directory. mkdir -p "$d" || return 1 chmod 750 "$d" || return 1 chown "${openerp_server_user}:wheel" "$d" || return 1 fi } load_rc_config $name run_rc_command "$1" >>>>>>>>>>>>>>>>>>>>>