From owner-freebsd-hackers@freebsd.org Wed Dec 23 21:33:56 2015 Return-Path: Delivered-To: freebsd-hackers@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 570C7A50E37; Wed, 23 Dec 2015 21:33:56 +0000 (UTC) (envelope-from lists@bertram-scharpf.de) Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.135]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mout.kundenserver.de", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AA4A412A8; Wed, 23 Dec 2015 21:33:54 +0000 (UTC) (envelope-from lists@bertram-scharpf.de) Received: from becker.bs.l ([85.180.12.203]) by mrelayeu.kundenserver.de (mreue003) with ESMTPSA (Nemesis) id 0MOELI-1a8Xf20bpc-005ak9; Wed, 23 Dec 2015 22:33:52 +0100 Received: from bsch by becker.bs.l with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1aBr2d-0000Lu-Ez; Wed, 23 Dec 2015 22:33:51 +0100 Date: Wed, 23 Dec 2015 22:33:51 +0100 From: Bertram Scharpf To: freebsd-questions@freebsd.org, freebsd-hackers@freebsd.org Subject: Re: PATH variable in lpd's process Message-ID: <20151223213351.GA1304@becker.bs.l> Mail-Followup-To: freebsd-questions@freebsd.org, freebsd-hackers@freebsd.org References: <20151221164338.GB33124@becker.bs.l> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20151221164338.GB33124@becker.bs.l> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: Bertram Scharpf X-Provags-ID: V03:K0:6ncJMxeLZEjE5h2IyPBfhVp//3cg/zTJTkth4MOYWdq6+R6GvUH BuuTyoigpmGCwrIruPgcBzsAXLeREm66jz+5f+qtbYvTH7V7P7NC1QLZaYiO1PDFGXJNGsp h4m9gn+ue8so3KT/D5MZYzWqoEGa91ej0MFcVAcyRhXV+Ddv4LzPZbYg6vb28UyrOUok5OK IxcZtI7FqjyjtyqYJD6dQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:DpYQ8ZDhlGE=:bMXEYgKSBwll5pWsMvQPN6 1QxhBhY8F1rYeF9IGnmLBmGP3Ll10ifeWVwGyZsHeQcX2sOidnQZ0xXGTt5O/GTmtYONudD+6 YMKJ4f+WAuaaudXdBK32BBYjXGpjDFWSX2xdYj2oNm00UO3LU9xsDprsDdeafMHYSDsgVsH+B K0zI5mkzQ1SOOk/N/om38oW+vsKyuuXhPkQAV+iFAh4IFMLLOWzFs+c4ZJ6DZJAiYrjQbshfq rmMubn/e7/8lGv20hR9N5jvqrFqvkohnnwG/1ChU3/CbuVtrzFktOOHrLUvrBD5B8u2b7d2bI q9nlT8kaZ2577BhYOxcOUSOvaKhOrcYXBggKjV4XT3dBFm+LQke8VQhU97j094wMDx0QRumYC zZiU8kN8KQ5FU1SiGMBbY+1SvopkNDu0eP0QUl/D93mDOLc2zUdRN5QANv/FfBaliKNvxBzL4 LLQK+43A0YcXsbBaWd0/svxJwCKNiHeDfojIaJI45IbRTtMpMvhOKgeJgEGQLPYyuTPPx+Gn8 7n4GeLivx7e5GuQLn/vPvAILTlTL1M6tdCbuPTVBR8YzhGBD64mGImNyzQ59hcgnB1q8UE7GQ MnFT4Lkis0Th5dc1AK3A9xtX1bY1UCLoGMGK/JwUzlEPq+C307akLvBxfh6R0XbBjqh5YKhLn tUVSBEkEFLSuAIK331nY3f02htE+WDg4Wp4kOrnLrRJpvEne26dRBWoA3lwE0LPXYbl0= X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2015 21:33:56 -0000 Hi, On Monday, 21. Dec 2015, 17:43:38 +0100, 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. > > [...] > > "/etc/crontab" allows to reset the PATH variable but I do > not see a way to do the same in "/etc/printcap". I decided unhesitatingly to extend the lpd printcap mechanism and I added a filter-path variable that will be put into the filter processes before calling exec there. I think this should be part of the official FreeBSD release. Where is the right place to propose it? Bertram -- Bertram Scharpf Stuttgart, Deutschland/Germany http://www.bertram-scharpf.de