From owner-freebsd-stable@freebsd.org Thu Sep 1 17:03:21 2016 Return-Path: Delivered-To: freebsd-stable@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 0C556BCB28B for ; Thu, 1 Sep 2016 17:03:21 +0000 (UTC) (envelope-from ultima1252@gmail.com) Received: from mail-yw0-x233.google.com (mail-yw0-x233.google.com [IPv6:2607:f8b0:4002:c05::233]) (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 BDAEFF62 for ; Thu, 1 Sep 2016 17:03:20 +0000 (UTC) (envelope-from ultima1252@gmail.com) Received: by mail-yw0-x233.google.com with SMTP id r9so54325723ywg.0 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=8CzoqczuFlm5bAcNO7/jDuD9rBwRs30ZzBe09gnaZQY=; b=t0MyKpyABniowtL5N/8A4XldQXFspNhGdE16xE6eWV0u+CrsgGz4BfdW39LlK66V80 ufGXVQ1AzXs48lbrvoaLDHeK9xY92fNVrc7ZOE35KOtAC3IgvLzu811rBOL+2QlNIFYA VoprVsKF9yX68UexkebgQVzhAX0nnmVzGv9a2std4+lsrzgPH9To0n5UpwM5M35HLDQt +xpgDAIS1LgyPoQW642cjoJiz7eZ05BNkkrbxgieNbsDbZinXuu1hEcLnJvI9LnhXsWF f+a8T2p+X4roG9Re9OhTfjFSrxAN4d+tWcWQzipz/OTPgXXXk0CU5G/FiJwgBXvu+fbf 0kiw== 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=8CzoqczuFlm5bAcNO7/jDuD9rBwRs30ZzBe09gnaZQY=; b=FedSSfplaQ/sRk9+DmNmzkUyXInvsa1Sx4S0mhHkYEbTqDm6218qKXcWqKz80gfWuB gR15U0DJC3aodCPmuI+Ot0uPZBoqQNryIDV+W2kVgDF0nsIh0ynwLM2xYIURTB6a0/Q7 jvpCkzB/CZ9YUbjFfcS2F5ypwP+oTHKXZm4gwn/9US1etv8ZJwZh3Or0XduERGVG29T2 IyPDiaofvOKYX7Pm1xTU+45c3JPZPKVxLibqTllfDRXAAgKWgO4eKm39sxseCZL4uF/A XmpAAAyjs4fSB47CDtNf7h4cX6TOxKHAAZp+iqy4BbB56/rZgrJe3c/kwtM5lHUzz/DV kMTQ== X-Gm-Message-State: AE9vXwOHat6/D7Ah+upECcI+533ASRPAFvVc7YVYGZwBD1rPkhddjsSidDU7T82Coz4TS8+9yqkq9JHhVA4aeQ== X-Received: by 10.13.219.199 with SMTP id d190mt15851340ywe.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-stable@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Production branch of FreeBSD source code 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.