From owner-freebsd-questions@FreeBSD.ORG Fri Jan 8 10:23:56 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C5D38106566B for ; Fri, 8 Jan 2010 10:23:56 +0000 (UTC) (envelope-from samankaya@netscape.net) Received: from imr-mb02.mx.aol.com (imr-mb02.mx.aol.com [64.12.207.163]) by mx1.freebsd.org (Postfix) with ESMTP id 87B418FC13 for ; Fri, 8 Jan 2010 10:23:56 +0000 (UTC) Received: from imo-da01.mx.aol.com (imo-da01.mx.aol.com [205.188.169.199]) by imr-mb02.mx.aol.com (8.14.1/8.14.1) with ESMTP id o08ANjaJ015934 for ; Fri, 8 Jan 2010 05:23:45 -0500 Received: from samankaya@netscape.net by imo-da01.mx.aol.com (mail_out_v42.5.) id n.cea.6ce0679d (44219) for ; Fri, 8 Jan 2010 05:23:44 -0500 (EST) Received: from [172.16.1.2] (mail.reformkurumsal.com [212.156.209.87]) by cia-dd07.mx.aol.com (v127.7) with ESMTP id MAILCIADD075-acbb4b4707ad18d; Fri, 08 Jan 2010 05:23:43 -0500 Message-ID: <4B4707AC.7050908@netscape.net> Date: Fri, 08 Jan 2010 12:23:40 +0200 From: Kaya Saman User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.22) Gecko/20090605 SeaMonkey/1.1.17 (Ubuntu-1.1.17+nobinonly-0ubuntu0.9.04.1) MIME-Version: 1.0 To: freebsd-questions@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-AOL-IP: 212.156.209.87 X-Mailer: Unknown (No Version) X-Spam-Flag: NO X-AOL-SENDER: samankaya@netscape.net Subject: rc.d script not working for Xmms2 :-( X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2010 10:23:56 -0000 Hi guys, I'm just attempting to create a startup script for Xmms2 so that the service can autostart on boot! So far I have Google'd around and found very little, the most promising site was this: http://www.freebsd.org/doc/en/articles/rc-scripting/rcng-daemon.html which gives a script of this: #!/bin/sh . /etc/rc.subr name="mumbled" rcvar=`set_rcvar` command="/usr/sbin/${name} load_rc_config $name run_rc_command "$1" So far I have modified the script to look like this: #!/bin/sh . /etc/rc.subr name="xmms2-launcher" rcvar=`set_rcvar` command="/usr/local/bin/${name}" -u kaya load_rc_config $name run_rc_command "$1" and given it the name xmms2-launcher, the location of the script is in /usr/local/etc/rc.d/ I also have this line in /etc/rc.conf: xmms2-launcher_enable="YES" Only when I attempt to start the script I get this information back: -u: not found xmms2-launcher_enable=YES: not found ./xmms2-launcher: WARNING: $xmms2-launcher_enable is not set properly - see rc.conf(5). Cannot 'start' xmms2-launcher. Set xmms2-launcher_enable to YES in /etc/rc.conf or use 'onestart' instead of 'start'. I would like to start the daemon as user kaya which is why I have the -u added in the script but am completely lost now as I'm not great at scripting since this is quite advanced for the simple stuff I do know about! Can anyone help me?? Many thanks and best regards, Kaya