From owner-freebsd-questions@freebsd.org Mon Dec 21 16:43:42 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 670EDA4D9BC for ; Mon, 21 Dec 2015 16:43:42 +0000 (UTC) (envelope-from lists@bertram-scharpf.de) Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.131]) (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 BD851133A for ; Mon, 21 Dec 2015 16:43:41 +0000 (UTC) (envelope-from lists@bertram-scharpf.de) Received: from becker.bs.l ([85.180.6.36]) by mrelayeu.kundenserver.de (mreue002) with ESMTPSA (Nemesis) id 0M7yDJ-1aOkv40yn3-00vhZI for ; Mon, 21 Dec 2015 17:43:39 +0100 Received: from bsch by becker.bs.l with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1aB3Yg-0008hI-KG for freebsd-questions@freebsd.org; Mon, 21 Dec 2015 17:43:38 +0100 Date: Mon, 21 Dec 2015 17:43:38 +0100 From: Bertram Scharpf To: freebsd-questions@freebsd.org Subject: PATH variable in lpd's process Message-ID: <20151221164338.GB33124@becker.bs.l> Mail-Followup-To: freebsd-questions@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) Sender: Bertram Scharpf X-Provags-ID: V03:K0:YrlG/oJ+3k9l321oXLwnkZf/VD+1Ht4lOfd3xtQWBGzuPVSwd8P 20dhLPUhUb9i4fLBjaD86bostzWGPD4Cmdl807jHWuW8w04tHudREEvSYEiXTPBycsLzy+W Rn6Jo3P2wzksJNTRnTuaO6Qnj0MHcSt2kydFxvn0zVClTp3DV+7IiGYkIAdb/oleGUak5FY VJKPBAxZI1vafDYTiQo2A== X-UI-Out-Filterresults: notjunk:1;V01:K0:yupPf0a59is=:UcRHttuW1v5wAvBu6l/LzM Z14t3yGScyeo+9qyxwumoOoZsCS4zYQeoLqnje5/lwEhJlAYQ5xg17M3X5IdwlfopjK7cDNsy YSHVtPpsIyPEGGSauI1JssQ44OAiAef4pcuqBdhndNMp/c7r+V4QzZZ5/YrquF1IiY/35MIdq kluv0NbY3OYAGcTdJvSpqcjctE530ws38/mCifHsGISr3XSySb11bSCA8WjTEUcAJOrXl5kIt H3tWlMzq0IepYFp6uWpYEjcIBVLyOcV1SSF4mG9ZPFpKz2p/mAP/TdteHB90/yvzaCULDhPaS UiFPDibq6bBVKBvaNrnKmxi1vQu/ih1YE4rEjrZwDFSVJ4161tqPTIbonX5ed8ur3mpUf9oyZ 3piEcdB5vX7OtnSfMq7lejh/2KCp8jR26tjbgxbGCA5HJwKOxVEP1n7wLTHYq+2U2h9/w3QmR cLzPxhttp5fKXleyzAu+weakj96lchwCw36B8OkN6TKfL8BzCyniBiz6UWHVc/ZyXMmrUcnth A+2UZOEW/+EaulFSw8oQIcH4+rUC5OroEdjWl441JGPs+3bepN0BsjYeZnjvw+zmV6xC32ZuM BOlSu1iYL7fPWe9clLk9QGvnkCBGSPwkIU+IUZDwFs1b7tVdNU2cJOvcKo0sBEilrh0JMOkOo cqenFLZ+Jw2Zik6eR1bSwkLvuIEtCjpWbENtbROHuUivMAAssMZOK6Pd17Z9SXODUcZg= 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: Mon, 21 Dec 2015 16:43:42 -0000 Hi, 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? Bertram -- Bertram Scharpf Stuttgart, Deutschland/Germany http://www.bertram-scharpf.de