From owner-freebsd-questions@freebsd.org Tue Dec 22 19:34:17 2015 Return-Path: Delivered-To: freebsd-questions@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 D319DA4F4C5 for ; Tue, 22 Dec 2015 19:34:17 +0000 (UTC) (envelope-from wblock@wonkity.com) Received: from wonkity.com (wonkity.com [67.158.26.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "wonkity.com", Issuer "wonkity.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id A6B6C15D8 for ; Tue, 22 Dec 2015 19:34:17 +0000 (UTC) (envelope-from wblock@wonkity.com) Received: from wonkity.com (localhost [127.0.0.1]) by wonkity.com (8.15.2/8.15.2) with ESMTPS id tBMJY5Xc058903 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 22 Dec 2015 12:34:05 -0700 (MST) (envelope-from wblock@wonkity.com) Received: from localhost (wblock@localhost) by wonkity.com (8.15.2/8.15.2/Submit) with ESMTP id tBMJY4FB058900; Tue, 22 Dec 2015 12:34:04 -0700 (MST) (envelope-from wblock@wonkity.com) Date: Tue, 22 Dec 2015 12:34:04 -0700 (MST) From: Warren Block To: Bertram Scharpf cc: freebsd-questions@freebsd.org Subject: Re: PATH variable in lpd's process In-Reply-To: <20151221164338.GB33124@becker.bs.l> Message-ID: References: <20151221164338.GB33124@becker.bs.l> User-Agent: Alpine 2.20 (BSF 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset=US-ASCII X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (wonkity.com [127.0.0.1]); Tue, 22 Dec 2015 12:34:05 -0700 (MST) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2015 19:34:17 -0000 On Mon, 21 Dec 2015, Bertram Scharpf wrote: > in my "/etc/printcap", the "if" field points to an input > filter I wrote in Ruby. There, the first line is a shebang > saying > > #!/usr/bin/env ruby > > Further there is > > # procstat -e `pgrep lpd` > PID COMM ENVIRONMENT > 940 lpd PATH=/sbin:/bin:/usr/sbin:/usr/bin PWD=/ HOME=/ RC_PID=20 > > As you can easily see, I will receive a mail saying the > print job failed because of > > env: ruby: No such file or directory > > When I restart "lpd" from the command line, the new process > receives the environment variables from the shell process > and everything ist fine. > > So far I found two ways to solve this neither of them I like > very much: > > - Tweaking the PATH variable in "etc/rc" in the source > tree and reinstall by "make distribution". > > - Patching the filter programms installation method to > modify the shebang line using "/usr/local/bin/ruby". > > "/etc/crontab" allows to reset the PATH variable but I do > not see a way to do the same in "/etc/printcap". > > Is there a better way to solve my problem and is there a > recommended one? env has the -S option where a path value can be specified. So it will work whether $PATH is set or not.