From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 12 15:25:38 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 7980056F for ; Mon, 12 Aug 2013 15:25:38 +0000 (UTC) (envelope-from joris.dedieu@gmail.com) Received: from mail-la0-x22a.google.com (mail-la0-x22a.google.com [IPv6:2a00:1450:4010:c03::22a]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id F346C2693 for ; Mon, 12 Aug 2013 15:25:37 +0000 (UTC) Received: by mail-la0-f42.google.com with SMTP id mf11so4867667lab.1 for ; Mon, 12 Aug 2013 08:25:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=2QsH1yC1+3dwE5wdVh+fODoJ+MI+Uxuexrhj31/n/KY=; b=TLSaz1amk8U9AcWotKUw2DsXKnj1GmLNdMelhmAWfAzqDs4XZP+rJL6gqbgPcuKvOA /lAseLGGDzn1EdmWRaW4Yweu80oaZEPh26I8kC0iR/ZxajHLe/woAoxXRoxjAdXPhdjZ 1DgOIwL76YYswA+GxXqnhmDCZu0fjSh/HGDMixBRzpWKIQINc2ZjBNPDpvzkeUzlf9/v tyM3cgFN0aouaH7VGUsxU3q64/qdj6wSRDGaavK6g1NE1Hmj464Da7phQgLF2RPt7oCU U5j9J0LXKcYa33gvEqFEPHvnXOgweXXy88fpjwU2PcbkxIH+R9b1ODQQj8gU+FJuxk12 gxXw== MIME-Version: 1.0 X-Received: by 10.112.211.136 with SMTP id nc8mr6553191lbc.80.1376321135985; Mon, 12 Aug 2013 08:25:35 -0700 (PDT) Received: by 10.114.22.99 with HTTP; Mon, 12 Aug 2013 08:25:35 -0700 (PDT) In-Reply-To: References: Date: Mon, 12 Aug 2013 17:25:35 +0200 Message-ID: Subject: Re: how to make a etc/rc.d start at boot time From: joris dedieu To: Aryeh Friedman Content-Type: text/plain; charset=ISO-8859-1 Cc: FreeBSD Mailing List X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Aug 2013 15:25:38 -0000 2013/8/11 Aryeh Friedman : > ---------- Forwarded message ---------- > From: Aryeh Friedman > Date: Sun, Aug 11, 2013 at 2:07 AM > Subject: Re: how to make a etc/rc.d start at boot time > To: Rui Paulo > > > #!/bin/sh > # > # Start/stop XXX at boot time > # > # Copyright (C) 2013 XXX > > . /etc/rc.subr > > name="XXX" rcvar=XXX_enable pidfile="/var/run/rXXX.pid" > start_cmd="${name}_start" > stop_cmd=":" > > XXX_start() { > echo "$name started." > /usr/local/openjdk6/bin/java -cp \ > /usr/local/share/XXX/XXX.jar \ > XXX.yyy \ > /usr/local/etc/XXX/YYY& > } You don't need to overwrite start_cmd java_command="%%LOCALBASE%%/bin/java" XXX_classpath="/usr/local/share/XXX/XXX.jar" XXX_start_cmd="${java_command} -cp ${XXX_classpath} ..." command="/usr/sbin/daemon" flags="-p ${pidfile} ${XXX_start_cmd}" > > load_rc_config $name This have to come earlier in the script See : http://www.freebsd.org/doc/en/books/porters-handbook/rc-scripts.html Joris > > run_rc_command "$1" > > > On Sun, Aug 11, 2013 at 1:37 AM, Rui Paulo wrote: >> On 10 Aug 2013, at 22:31, Aryeh Friedman wrote: >> >>> I am creating a port for something that needs to start a daemon at >>> boot time I have it so I can call onestart on it but XXX_enable="YES" >>> in /etc/rc.conf fails to load it.... i.e. >>> >>> >>> /usr/local/etc/rc.d/XXX onestart -- works >>> XXX_enable="YES" -- fails >> >> Please post your script. >> >> -- >> Rui Paulo >> >> >> > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"