Changeset 92:b201ba1353fb in livinglogic.python.tipimaid

Show
Ignore:
Timestamp:
02/12/09 18:08:29 (10 years ago)
Author:
Nik Tautenhahn <nik@…>
Branch:
default
Message:

start executables in a shell

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • liaalh.py

    r91 r92  
    418418        try: 
    419419            if subprocessworks: 
    420                 retcode = subprocess.call([self.execute, filename]) 
     420                retcode = subprocess.call("%s %s" % (self.execute, filename), shell=True) 
    421421            else: 
    422422                retcode = os.system("%s %s" % (self.execute, filename)) 
     
    499499    p.add_option("-u", "--utcrotate", dest="utcrotate", action="store_true", help="If set, UTC time determines the time for filenames and rotation. Otherwise local time is used.", default=False) 
    500500    p.add_option("-s", "--symlink", dest="symlinkpattern", metavar="FILEPATTERN", action="store", help="""Create a symlink pointing to the most recent log file (of each virtual host if you use %v). Needs a filename pattern for the symlink (e.g. %v/access.log or symlinks/access-%v.log). Only "%v" is allowed in the pattern as symlinks which include time/date data are useless.""", default=None) 
    501     p.add_option("-x", "--execute", dest="execute", metavar="COMMAND", type="string", action="store", help="After writing to a logfile is finished and a new one is created (e.g. after rotating the logs), the given executable is started with the finished logfile as its first (and only) parameter. You could use gzip, bzip2, a self-written bash-script or even rm here.", default=None) 
     501    p.add_option("-x", "--execute", dest="execute", metavar="COMMAND", type="string", action="store", help="""After writing to a logfile is finished and a new one is created (e.g. after rotating the logs), the given executable is started with the finished logfile as its parameter. You could use gzip, bzip2, a self-written bash-script or even rm here. Use quotation marks if your command contains parameters of its own, e.g. -x "gzip -9".""", default=None) 
    502502    p.add_option("-t", "--threads", dest="num_threads", metavar="NUMBER_OF_THREADS", type="int", action="store", help="Specifies the number of allowed worker threads for -x/--execute, default is 3", default=3) 
    503503    (options, args) = p.parse_args()