From owner-freebsd-perl@FreeBSD.ORG Thu Jan 26 16:02:25 2012 Return-Path: Delivered-To: perl@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1FD221065676 for ; Thu, 26 Jan 2012 16:02:25 +0000 (UTC) (envelope-from scheidell@freebsd.org) Received: from mx2.secnap.com.ionspam.net (mx2.secnap.com.ionspam.net [216.134.223.54]) by mx1.freebsd.org (Postfix) with ESMTP id E3AAF8FC0A for ; Thu, 26 Jan 2012 16:02:24 +0000 (UTC) Received: from mx2.secnap.com.ionspam.net (unknown [10.71.0.54]) by mx2.secnap.com.ionspam.net (Postfix) with ESMTP id AD414D23C2B; Thu, 26 Jan 2012 10:39:22 -0500 (EST) X-Virus-Scanned: SpammerTrap(r) VPS-1500 2.17 at mx2.secnap.com.ionspam.net Received: from USBCTDC001.secnap.com (unknown [10.70.1.1]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mx2.secnap.com.ionspam.net (Postfix) with ESMTPS id 709C2D23C0D; Thu, 26 Jan 2012 10:39:21 -0500 (EST) Received: from macintosh.secnap.com (10.70.3.3) by USBCTDC001.secnap.com (10.70.1.1) with Microsoft SMTP Server (TLS) id 14.0.722.0; Thu, 26 Jan 2012 10:39:20 -0500 Message-ID: <4F2173A8.5010803@freebsd.org> Date: Thu, 26 Jan 2012 10:39:20 -0500 From: Michael Scheidell Organization: SECNAP Network Security Corp User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.20) Gecko/20110804 Thunderbird/3.1.12 MIME-Version: 1.0 Followup-To: ports@freebsd.org To: Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit Cc: ports@freebsd.org Subject: what is maxcmdlen? $0 len? X-BeenThere: freebsd-perl@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: maintainer of a number of perl-related ports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2012 16:02:25 -0000 (followups set to ports@) I am trying to track down a persistent bug in swatch. swatch sets y $commandLineString = $0 . ' ' . join(' ', @ARGV); , and if the len of the cmdargs is > (x?), then ps gets borked, rc scripts can't find it (so service status won't work), service restart won' t kill old one, so it just keep adding new instances. perldoc says: http://perldoc.perl.org/perlvar.html "Note that there are platform-specific limitations on the maximum length of $0 . In the most extreme case it may be limited to the space occupied by the original $0 ." (but, I searched and could not find it) best I can tell, this number is 251. (possibly 255) (in swatch.rc, swatch_flags -gt 222 chars), so, swatch_flags, then len of command (/usr/local/bin/swatch), some spacing, the '(perl)' at end... and something else. other than putting something like this in rc file, is there a way to tell, on a platform by platform basis, what this number is? should I send patches to swatch upstream to prevent this from happening? notes: swatch_1_flags='-c /usr/local/etc/swatch-hackertrap.conf --tail-file=/var/log/eventlog_this_is_an_incredable_log_file_that_should_cause_big_problems_yes_an_op_would_never_do_this_but_it_is_so_I_can_test_if_problem_is_log_file_arg_or_log_cmd_arg_or_a_lot_of_files_or_some_thing_in_between_and_or.log --tail-args=-Fn0 --daemon --script-dir=/tmp/ --pid-file=/var/run/swatch_1.pid' swatch_enable="YES" ps -auxww | grep swatch root 86920 0.0 0.7 7496 6960 ?? Is 9:33AM 0:00.01 /usr/local/bin/perl /tmp//.swatch_script.86918 ./swatch status 329 swatch is not running. ./swatch status 223 swatch is not running. ./swatch status 222 swatch is running as pid 98668. -- Michael Scheidell, CTO o: 561-999-5000 d: 561-948-2259 >*| *SECNAP Network Security Corporation * Best Mobile Solutions Product of 2011 * Best Intrusion Prevention Product * Hot Company Finalist 2011 * Best Email Security Product * Certified SNORT Integrator