Date: Thu, 21 Feb 2002 22:36:02 -0500 From: Eric I.Arnoth <earnoth@comcast.net> To: "Crist J. Clark" <cjc@FreeBSD.ORG> Cc: freebsd-questions@FreeBSD.ORG Subject: Re: syslog.conf problems Message-ID: <20020222033846.MDLM14626.femail23.sdc1.sfba.home.com@there> In-Reply-To: <20020221041623.Q48401@blossom.cjclark.org> References: <20020221030958.QQRM18863.femail11.sdc1.sfba.home.com@there> <20020221041623.Q48401@blossom.cjclark.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thursday 21 February 2002 07:16, you wrote:
>
> You'll kick yourself. Is /hello_log.sh set executable?
Ugghh....no, it wasn't. <sigh>
Now that I chmod'd it properly, the bourne scipt runs just fine. I then
tried to make it echo the line to my python script, thusly:
--------------------------------------------------------
#!/bin/sh
read line
echo "$line" | /hello_log.py
--------------------------------------------------------
It works just fine. Thus explaining to me the man page's comments about
shell script wrapper to set up the run-once-and-die mechanism.
So now that I have the proof of concept, I can do whatever I want in Python,
such as parse the output and send it to Postgresql.
Thanks much for the simple assist, though I am quite embarassed that it was
such a simple detail. I still don't understand why the Python script on it
won't run properly. (It is 755 perm ;-)
hello_log.py
--------------------------------------------------------
#!/usr/local/bin/python
import sys
test_file = open("/test.out", 'a')
test_file.write(sys.__stdin__.read())
test_file.flush()
test_file.close()
sys.exit()
--------------------------------------------------------
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020222033846.MDLM14626.femail23.sdc1.sfba.home.com>
