Sponsored Content
Special Forums UNIX and Linux Applications Logrotate with catalina.out "daily compressed file is overwriting the logs" Post 302963948 by thiyagoo on Friday 8th of January 2016 07:40:07 AM
Old 01-08-2016
Logrotate with catalina.out "daily compressed file is overwriting the logs"

Hi Everyone,

We are trying to do a logrotate for "catalina.out" daily, So have used the "copytruncate" option in the logrotate configuration but ended up seeing there was a 0kb file touched with "catalina.out" and the other file with the current date(compressed) file created and seems the log is writing to it as below.

The expected behavior is the log should be written to "catalina.out" and there should not be a today dated compressed file that is getting written. Can someone please suggest..

Config:
Code:
/var/log/tomcat/catalina.out {
    copytruncate
    daily
    rotate 7
    compress
    missingok
}

Code:
Log file:
-rw-rw-r-- 1 tomcat www 139K Dec 21 03:39 catalina.out-20151220.gz
-rw-rw-r-- 1 tomcat www  20K Jan  5 06:48 catalina.out-20160105.gz
-rw-rw-r-- 1 tomcat www 3.9K Jan  6 03:11 catalina.out-20160106.gz
-rw-rw-r-- 1 tomcat www  11K Jan  7 03:43 catalina.out-20160107.gz
-rw-rw-r-- 1 tomcat www 2.9K Jan  8 03:41 catalina.out-20160108.gz   ----- it's getting updated here & it should have not been compressed today..
-rw-rw-r-- 1 tomcat www    0 Jan  8 03:41 catalina.out  ----- Expecting this file to be updated
 logrotate.d]$ date
Fri Jan  8 06:41:34 CST 2016

Moderator's Comments:
Mod Comment Please use code tags.

-
Thiyags.

Last edited by jim mcnamara; 01-08-2016 at 09:38 AM..
 

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

"looping" compressed file

I've got a problem with a .z compressed file: when I decompress it, I get a .gz file, and when I decompress this one, I get the previous .z file again! Does anyone know how do I break off this loop? (1 Reply)
Discussion started by: exile
1 Replies

2. UNIX for Dummies Questions & Answers

Does "gzip" have a no prompt option on it for overwriting if file exists?

So I dont enounter things like: gzip: /sometimename.gz already exists; do you wish to overwrite (y or n)? Want to add it into a script and if there is a file aready there to just overwrite it, otherwise the script will hang unless there is manual intervention. (1 Reply)
Discussion started by: LordJezo
1 Replies

3. Shell Programming and Scripting

catalina.sh : need combination from "start" and "run"

heya, can someone help me with following problem. i am not sure how far you know the catalina.sh script from tomcat. when i start my tomcat with "catalina.sh run" then the startup-process-output will be printed out on the console, but the tomcat process is started in current shell/session, so... (1 Reply)
Discussion started by: Filly
1 Replies

4. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

5. Shell Programming and Scripting

Perl failure with "main::$fn" used only once:" in error logs

Hi all, Can anyone guess why this is happening? I am new to Perl, so please help me to fix this error: - I have a static html file which calls the cgi-perl script. HTML Code: <html> <head> <title> Hey Dude! </title> </head> <body> <form method="POST"... (3 Replies)
Discussion started by: bashily
3 Replies

6. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

7. UNIX for Beginners Questions & Answers

"unzip" compressed security camera videos

Good afternoon, I started apologizing for not creating a specific topic with my subject, I could not find the option to create a topic, friends, if someone can help me thank you very much, I have a problem, I have a DVR with a HISILICON HI chip 3520, it compresses and encrypts the videos recorded... (2 Replies)
Discussion started by: cristopher0258
2 Replies

8. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies
tomcat_selinux(8)					       SELinux Policy tomcat						 tomcat_selinux(8)

NAME
tomcat_selinux - Security Enhanced Linux Policy for the tomcat processes DESCRIPTION
Security-Enhanced Linux secures the tomcat processes via flexible mandatory access control. The tomcat processes execute with the tomcat_t SELinux type. You can check if you have these processes running by executing the ps command with the -Z qualifier. For example: ps -eZ | grep tomcat_t ENTRYPOINTS
The tomcat_t SELinux type can be entered via the unlabeled_t, proc_type, file_type, mtrr_device_t, filesystem_type, sysctl_type, tom- cat_exec_t file types. The default entrypoint paths for the tomcat_t domain are the following: all files on the system, /dev/cpu/mtrr, /usr/sbin/tomcat(6)? PROCESS TYPES
SELinux defines process types (domains) for each process running on the system You can see the context of a process using the -Z option to ps Policy governs the access confined processes have to files. SELinux tomcat policy is very flexible allowing users to setup their tomcat processes in as secure a method as possible. The following process types are defined for tomcat: tomcat_t Note: semanage permissive -a tomcat_t can be used to make the process type tomcat_t permissive. SELinux does not deny access to permissive process types, but the AVC (SELinux denials) messages are still generated. BOOLEANS
SELinux policy is customizable based on least access required. tomcat policy is extremely flexible and has several booleans that allow you to manipulate the policy and run tomcat with the tightest access possible. If you want to allow all daemons to write corefiles to /, you must turn on the daemons_dump_core boolean. Disabled by default. setsebool -P daemons_dump_core 1 If you want to enable cluster mode for daemons, you must turn on the daemons_enable_cluster_mode boolean. Enabled by default. setsebool -P daemons_enable_cluster_mode 1 If you want to allow all daemons to use tcp wrappers, you must turn on the daemons_use_tcp_wrapper boolean. Disabled by default. setsebool -P daemons_use_tcp_wrapper 1 If you want to allow all daemons the ability to read/write terminals, you must turn on the daemons_use_tty boolean. Disabled by default. setsebool -P daemons_use_tty 1 If you want to deny user domains applications to map a memory region as both executable and writable, this is dangerous and the executable should be reported in bugzilla, you must turn on the deny_execmem boolean. Enabled by default. setsebool -P deny_execmem 1 If you want to deny any process from ptracing or debugging any other processes, you must turn on the deny_ptrace boolean. Enabled by default. setsebool -P deny_ptrace 1 If you want to allow all domains to use other domains file descriptors, you must turn on the domain_fd_use boolean. Enabled by default. setsebool -P domain_fd_use 1 If you want to allow all domains to have the kernel load modules, you must turn on the domain_kernel_load_modules boolean. Disabled by default. setsebool -P domain_kernel_load_modules 1 If you want to allow all domains to execute in fips_mode, you must turn on the fips_mode boolean. Enabled by default. setsebool -P fips_mode 1 If you want to enable reading of urandom for all domains, you must turn on the global_ssp boolean. Disabled by default. setsebool -P global_ssp 1 If you want to control the ability to mmap a low area of the address space, as configured by /proc/sys/kernel/mmap_min_addr, you must turn on the mmap_low_allowed boolean. Disabled by default. setsebool -P mmap_low_allowed 1 If you want to allow confined applications to use nscd shared memory, you must turn on the nscd_use_shm boolean. Disabled by default. setsebool -P nscd_use_shm 1 If you want to disable kernel module loading, you must turn on the secure_mode_insmod boolean. Enabled by default. setsebool -P secure_mode_insmod 1 If you want to boolean to determine whether the system permits loading policy, setting enforcing mode, and changing boolean values. Set this to true and you have to reboot to set it back, you must turn on the secure_mode_policyload boolean. Enabled by default. setsebool -P secure_mode_policyload 1 If you want to allow unconfined executables to make their heap memory executable. Doing this is a really bad idea. Probably indicates a badly coded executable, but could indicate an attack. This executable should be reported in bugzilla, you must turn on the selin- uxuser_execheap boolean. Disabled by default. setsebool -P selinuxuser_execheap 1 If you want to allow all unconfined executables to use libraries requiring text relocation that are not labeled textrel_shlib_t, you must turn on the selinuxuser_execmod boolean. Enabled by default. setsebool -P selinuxuser_execmod 1 If you want to allow unconfined executables to make their stack executable. This should never, ever be necessary. Probably indicates a badly coded executable, but could indicate an attack. This executable should be reported in bugzilla, you must turn on the selin- uxuser_execstack boolean. Enabled by default. setsebool -P selinuxuser_execstack 1 If you want to support X userspace object manager, you must turn on the xserver_object_manager boolean. Enabled by default. setsebool -P xserver_object_manager 1 If you want to allow ZoneMinder to run su/sudo, you must turn on the zoneminder_run_sudo boolean. Disabled by default. setsebool -P zoneminder_run_sudo 1 MANAGED FILES
The SELinux process type tomcat_t can manage files labeled with the following file types. The paths listed are the default paths for these file types. Note the processes UID still need to have DAC permissions. file_type all files on the system FILE CONTEXTS
SELinux requires files to have an extended attribute to define the file type. You can see the context of a file using the -Z option to ls Policy governs the access confined processes have to these files. SELinux tomcat policy is very flexible allowing users to setup their tomcat processes in as secure a method as possible. STANDARD FILE CONTEXT SELinux defines the file context types for the tomcat, if you wanted to store files with these types in a diffent paths, you need to exe- cute the semanage command to sepecify alternate labeling and then use restorecon to put the labels on disk. semanage fcontext -a -t tomcat_cache_t '/srv/tomcat/content(/.*)?' restorecon -R -v /srv/mytomcat_content Note: SELinux often uses regular expressions to specify labels that match multiple files. The following file types are defined for tomcat: tomcat_cache_t - Set files with the tomcat_cache_t type, if you want to store the files under the /var/cache directory. tomcat_exec_t - Set files with the tomcat_exec_t type, if you want to transition an executable to the tomcat_t domain. tomcat_log_t - Set files with the tomcat_log_t type, if you want to treat the data as tomcat log data, usually stored under the /var/log directory. tomcat_tmp_t - Set files with the tomcat_tmp_t type, if you want to store tomcat temporary files in the /tmp directories. tomcat_unit_file_t - Set files with the tomcat_unit_file_t type, if you want to treat the files as tomcat unit content. tomcat_var_lib_t - Set files with the tomcat_var_lib_t type, if you want to store the tomcat files under the /var/lib directory. tomcat_var_run_t - Set files with the tomcat_var_run_t type, if you want to store the tomcat files under the /run or /var/run directory. Note: File context can be temporarily modified with the chcon command. If you want to permanently change the file context you need to use the semanage fcontext command. This will modify the SELinux labeling database. You will need to use restorecon to apply the labels. COMMANDS
semanage fcontext can also be used to manipulate default file context mappings. semanage permissive can also be used to manipulate whether or not a process type is permissive. semanage module can also be used to enable/disable/install/remove policy modules. semanage boolean can also be used to manipulate the booleans system-config-selinux is a GUI tool available to customize SELinux policy settings. AUTHOR
This manual page was auto-generated using sepolicy manpage . SEE ALSO
selinux(8), tomcat(8), semanage(8), restorecon(8), chcon(1), sepolicy(8) , setsebool(8) tomcat 14-06-10 tomcat_selinux(8)
All times are GMT -4. The time now is 01:24 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy