From owner-freebsd-current@freebsd.org Thu Sep 1 17:03:21 2016 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1DFD2BCB28E for ; Thu, 1 Sep 2016 17:03:21 +0000 (UTC) (envelope-from ultima1252@gmail.com) Received: from mail-yw0-x232.google.com (mail-yw0-x232.google.com [IPv6:2607:f8b0:4002:c05::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D2DBDF65 for ; Thu, 1 Sep 2016 17:03:20 +0000 (UTC) (envelope-from ultima1252@gmail.com) Received: by mail-yw0-x232.google.com with SMTP id j12so54238456ywb.2 for ; Thu, 01 Sep 2016 10:03:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:cc; bh=BYPJPrMy5sWj0DVhdFYbTcl7BlL3q0oLFZRaVRdRR+k=; b=uS0zeG35dNqb6F/oC//e1d3Cywb7hfZykmLSLGI58nw7mbMg8/xfl7aqDTyYhGR4hF 4WC8CfLBVEMNZpY1vdxt0CdEBD1wWfjAE+YQuXO896Y1MFLtBwide9YPpJensNyCtSuv 7jc/H2X+tJdgYTcRq+pqH9iWPJdLfgSoLdSHjsliOx18pq3vKbe4NYvmsMLb4Ay1p5lz WebX4/aIEF2LOnNlcFBwYB5X683iQUm/eEBl62J90ZpMuFqY72Y/lKRZOceygJeZHcHL LYeQhlKoVoCK+/tJv11GDkZv04bdjwugpCZqaocaCrERBbGMcXgX3UOfffFHJvj2WoUF 5eIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:cc; bh=BYPJPrMy5sWj0DVhdFYbTcl7BlL3q0oLFZRaVRdRR+k=; b=SsyFvUmDYbSPYsmZfNHHcrZd4FVz/hsL1HtfxYJTweG0rxfgFIw92H/Qet2Ok+n0Zz rVwmjwCeueWUKscehs+lMYQKojVSADOdGEuydyD03dtWL/7YBezltRr292tXRV/0dd5T DN83GBbPlu/vss+F5UWlSDzPf6WkRjg9+oh4v0BAMNvNa7sgwfEkVOeXNJ0m0MFYiax7 iSrFclqo7JNkR+KHNZ99Fn9i36QDELGVQASAg9mJ2uZFqojRFHVoKU5KEgh6bIo7+Nni pLff13OsxdWiWi8/YELUHTn+vB2ej5rIExFWo0S2O8rhV3++338IQxoN0oe8OnBQ6hWu 0CoQ== X-Gm-Message-State: AE9vXwOUAWf1O90zZ9KJ2lEPjpn5LzdgamG9sOJoeLaH2STsac5SO91P+noJT+DTqTmJf9KqOx0mwD3KrT2aPA== X-Received: by 10.13.219.199 with SMTP id d190mt15851342ywe.22.1472749399913; Thu, 01 Sep 2016 10:03:19 -0700 (PDT) MIME-Version: 1.0 Received: by 10.129.51.150 with HTTP; Thu, 1 Sep 2016 10:03:19 -0700 (PDT) From: Ultima Date: Thu, 1 Sep 2016 13:03:19 -0400 Message-ID: Subject: Need help debugging rc script Cc: freebsd-current@freebsd.org, freebsd-stable@freebsd.org, freebsd-ports@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Sep 2016 17:03:21 -0000 Hello, I'm dealing with an odd issue with an rc script working pre-11. The change that is causing the prog to fail seems to be the new limits feature, $name_login_class. After commenting out the limits command in rc.subr, the script starts as expected. Adding limits directly in the rc script with the daemon class will also start the script as expected (with limits commented out in rc.subr). For some reason that I cannot fathom it will just not start correctly with limits in rc.subr. So as the topic suggests, are they're better way to debug this? I'll also provide the scripts used in case someone may see something I'v missed. The jail is running on current, however this exists in 11 as well. 12.0-CURRENT FreeBSD 12.0-CURRENT #21 r304105 audio/teamspeak3-server # cat /usr/local/etc/rc.d/teamspeak #!/bin/sh # $FreeBSD$ # # PROVIDE: teamspeak # REQUIRE: LOGIN # KEYWORD: shutdown # # Add the following lines to /etc/rc.conf.local or /etc/rc.conf # to enable this service: # # teamspeak_enable (bool): Set to NO by default. # Set it to YES to enable teamspeak server. # . /etc/rc.subr name="teamspeak" rcvar=teamspeak_enable db_dir=/var/db/teamspeak log_dir=/var/log/teamspeak pidfile=/var/db/teamspeak/teamspeak_server.pid procname=/usr/local/libexec/ts3server command=/usr/sbin/daemon command_args="-fp $pidfile -u teamspeak /usr/local/libexec/ts3server dbsqlpath=/usr/local/share/teamspeak/server/sql/ inifile=/usr/local/etc/teamspeak/ts3server.ini licensepath=/usr/local/etc/teamspeak/ logpath=$log_dir" teamspeak_chdir=$db_dir required_dirs="$db_dir $log_dir" load_rc_config $name : ${teamspeak_enable="NO"} LD_LIBRARY_PATH=/usr/local/lib/teamspeak/server:$LD_LIBRARY_PATH export LD_LIBRARY_PATH run_rc_command "$1" This script causes an error, 2016-09-01 16:53:09.510292|ERROR |DatabaseQuery | |db_connect() failed unable to open database file 2016-09-01 16:53:09.510352|CRITICAL|ServerLibPriv | |Server() DatabaseError out of memory Commenting line 1075 in /etc/rc.subr, the program starts successfully.... Keeping line 1075 commented, change rc script to this. # cat /usr/local/etc/rc.d/teamspeak #!/bin/sh # $FreeBSD$ # # PROVIDE: teamspeak # REQUIRE: LOGIN # KEYWORD: shutdown # # Add the following lines to /etc/rc.conf.local or /etc/rc.conf # to enable this service: # # teamspeak_enable (bool): Set to NO by default. # Set it to YES to enable teamspeak server. # . /etc/rc.subr name="teamspeak" rcvar=teamspeak_enable db_dir=/var/db/teamspeak log_dir=/var/log/teamspeak pidfile=/var/db/teamspeak/teamspeak_server.pid procname=/usr/local/libexec/ts3server command=/usr/bin/limits command_args="-C daemon /usr/sbin/daemon -fp $pidfile -u teamspeak /usr/local/libexec/ts3server dbsqlpath=/usr/local/share/teamspeak/server/sql/ inifile=/usr/local/etc/teamspeak/ts3server.ini licensepath=/usr/local/etc/teamspeak/ logpath=$log_dir" teamspeak_chdir=$db_dir required_dirs="$db_dir $log_dir" load_rc_config $name : ${teamspeak_enable="NO"} LD_LIBRARY_PATH=/usr/local/lib/teamspeak/server:$LD_LIBRARY_PATH export LD_LIBRARY_PATH run_rc_command "$1" This is also start successfully.