Re: "tee" process being killed

Johan Hartzenberg <[email protected]> Sun, 12 Nov 2017 05:40:31 -0800 (PST)
Newsgroups gmane.comp.python.cherrypy
Message-ID <[email protected]>
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.