Re: "tee" process being killed
Andrew <[email protected]> Mon, 13 Nov 2017 02:25:33 -0800 (PST)
| Newsgroups | gmane.comp.python.cherrypy |
|---|---|
| Message-ID | <[email protected]> |
Hi,
When I use
sudo python -u server.py 2>&1 > server_log.dat &
there is some output that is printed to the terminal not the log file:
[ec2-user@ip-10-0-0-117 server]$ sudo python -u server.py 2>&1 >
server_log.dat &
[1] 15218
[ec2-user@ip-10-0-0-117 server]$ [13/Nov/2017:10:21:35] ENGINE Bus STARTING
[13/Nov/2017:10:21:35] ENGINE Started monitor thread '_TimeoutMonitor'.
[13/Nov/2017:10:21:35] ENGINE Started monitor thread 'Autoreloader'.
I am not sure if I run cherrypy in auto update mode. How do I check that?
Andrew
On Sunday, November 12, 2017 at 2:40:32 PM UTC+1, Johan Hartzenberg wrote:
>
> Note that tee runs as the original user.
>
> Don't know why tee gets killed - do you run your cherrypy in auto update
> mode?
>
> Do look at cherrypy logging... I don't use print from within cherrypy
> since when daemonised its output is not always where you think it should
> be. In stead of print write a console_print function like this
>
> I use the tag to sometimes just mark which request instance is busy doing
> the logging.
>
> I use a global debug setting to control outputting extra info.
>
>
> def console_print(*args, **kwargs):
> strings = []
> if kwargs.get("tag"):
> strings.append(kwargs.get("tag"))
> if cherrypy.config.get("debug"):
> for s in args:
> if isinstance(s, str):
> strings.append(s)
> else:
> strings.append(str(s))
>
> cherrypy.log(' '.join(strings))
>
>
>
> The log file is configured using an entry like this in your server config:
>
> log.access_file: "/home/svcuser/logs/service_access.log"
> log.error_file: "/home/svcuser/logs/service_error.log"
>
>
>
> On Saturday, November 11, 2017 at 3:54:07 PM UTC+2, Andrew wrote:
>>
>> Hi,
>>
>> I am running a cherrypy server like this
>>
>> sudo python -u server.py 2>&1 | tee server_log.dat >& /dev/null &
>>
>> The logging typically works fine for several hours but then the "tee"
>> process is killed and the logging stops.
>>
>> From the log file, there is no obvious cause for the "tee" process being
>> killed.
>>
>> Does anyone have any idea how I can debug this?
>>
>> Thanks.
>>
>> Andrew
>>
>
--
You received this message because you are subscribed to the Google Groups "cherrypy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cherrypy-users+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/[email protected]
To post to this group, send email to cherrypy-users-/JYPxA39Uh5TLH3MbocFF+G/[email protected]
Visit this group at https://groups.google.com/group/cherrypy-users.
For more options, visit https://groups.google.com/d/optout.