diff options
-rw-r--r-- | MANIFEST.in | 1 | ||||
-rw-r--r-- | cobbler.spec | 3 | ||||
-rw-r--r-- | cobbler/action_status.py | 11 | ||||
-rw-r--r-- | cobbler_rotate | 7 | ||||
-rw-r--r-- | setup.py | 14 | ||||
-rwxr-xr-x | watcher.py | 7 |
6 files changed, 18 insertions, 25 deletions
diff --git a/MANIFEST.in b/MANIFEST.in index 01460c67..b9c2f5e9 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -9,4 +9,3 @@ include cobbler.1.gz include COPYING AUTHORS README CHANGELOG NEWS include rsync.exclude include watcher.py -include cobbler_rotate diff --git a/cobbler.spec b/cobbler.spec index 8c333c0b..8e87471a 100644 --- a/cobbler.spec +++ b/cobbler.spec @@ -38,6 +38,7 @@ test "x$RPM_BUILD_ROOT" != "x" && rm -rf $RPM_BUILD_ROOT %files %defattr(-,apache,apache) %dir /var/log/cobbler +%dir /var/log/cobbler/kicklog %defattr(-,root,root) %{_bindir}/cobbler %dir /etc/cobbler @@ -54,8 +55,6 @@ test "x$RPM_BUILD_ROOT" != "x" && rm -rf $RPM_BUILD_ROOT %dir /var/lib/cobbler /var/lib/cobbler/elilo-3.6-ia64.efi /var/www/cobbler/watcher.py* -%attr(644, root, root) -/etc/logrotate.d/cobbler_rotate %doc AUTHORS CHANGELOG NEWS README COPYING diff --git a/cobbler/action_status.py b/cobbler/action_status.py index f288e7a3..81c621b0 100644 --- a/cobbler/action_status.py +++ b/cobbler/action_status.py @@ -14,6 +14,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. """ import os +import os.path +import glob import time import cobbler_msg @@ -41,12 +43,11 @@ class BootStatusReport: # gather stats from logfiles, allowing for rotations in the log file ... last_recorded_time = 0 time_collisions = 0 - for i in range(0,6): + + filelist = glob.glob("/var/log/cobbler/kicklog/*") + for i in filelist: - # figure out what logfile to open - fname = "/var/log/cobbler/cobbler.log" - if i != 0: - fname = "/var/log/cobbler/cobbler.log.%s" % (i) + fname = os.path.basename(i) # open it if it's there if not os.path.exists(fname): diff --git a/cobbler_rotate b/cobbler_rotate deleted file mode 100644 index bd4f1cd6..00000000 --- a/cobbler_rotate +++ /dev/null @@ -1,7 +0,0 @@ -/var/log/cobbler/cobbler.log { - rotate 4 - daily - nocompress - missingok - notifempty -} @@ -12,12 +12,12 @@ Cobbler is a command line tool for configuration of boot/provisioning, and updat if __name__ == "__main__": # docspath="share/doc/koan-%s/" % VERSION - manpath="share/man/man1/" - cobpath="/var/lib/cobbler/" - etcpath="/etc/cobbler/" - wwwpath="/var/www/cobbler/" - logpath="/etc/logrotate.d/" - logpath2="/var/log/cobbler/" + manpath = "share/man/man1/" + cobpath = "/var/lib/cobbler/" + etcpath = "/etc/cobbler/" + wwwpath = "/var/www/cobbler/" + logpath = "/var/log/cobbler/" + logpath2 = "/var/log/cobbler/kicklog" setup( name="cobbler", version = VERSION, @@ -37,7 +37,7 @@ if __name__ == "__main__": (etcpath, ['default.pxe']), (manpath, ['cobbler.1.gz']), (etcpath, ['rsync.exclude']), - (logpath, ['cobbler_rotate']), + (logpath, []), (logpath2, []) ], description = SHORT_DESC, @@ -15,12 +15,14 @@ from mod_python import apache def outputfilter(filter): - # open the logfile (directory be set writeable by installer) - logfile = open("/var/log/cobbler/cobbler.log","a+") # extract important info request = filter.req connection = request.connection + (address,port) = connection.remote_addr + + # open the logfile (directory be set writeable by installer) + logfile = open("/var/log/cobbler/kicklog/%s" % address,"a+") log_it = True if request.the_request.find("cobbler_track") == -1: @@ -37,7 +39,6 @@ def outputfilter(filter): logfile.write("\t") # write the IP address of the client - (address,port) = connection.remote_addr logfile.write(address) logfile.write("\t") |