Hello.
When rsyslog starts during boot ( or when it is restarted by hand ) , it read a config file which indicate some filter to use. And the filter syntax permit the use of environment variable as in my example "getenv('A_VAR_FLAG')" .
So do you mean that even if the global variable A_VAR_FLAG is created before rsyslog start, I have no way to change the point of view of rsyslog about the value of the variable A_VAR_FLAG ?
1. create two environment variables A_VAR_FLAG='ABCD' and B_VAR_FLAG="" in the process when it starts. This part has nothing to do with config files, just the cron (or services startup ) script needs to have two lines:
2. have two separate rsyslogd.conf (or whatever name you use) files, one which specifies
the other is identical except for
3. create 2 files, something_A and something_B (you make up names).
something_A is the original startup. At startup:
Basically I do not understand your requirement. At all. If you need to turn this filter on and off there are other more conventional ways to do it. Like stopping rsyslogd.
( I do not know the services command for your version but it amounts to this)
DGPickett is correct you cannot change a running process environment variables unless the process already has a direct means to change it. Specifically an IPC tool. Instead, you have to force the process to use another already existing variable, using a round about method. Or stop the process completely and recreate it with the right environment in the first place.
Last edited by jim mcnamara; 06-29-2013 at 08:06 PM..
One easy IPC is to fetch the value from a file each loop A_VAR_FLAGS=$(<file), or source (.) a small config file like a short .profile that can be modiified, so any proc can rewrite the file and change the next pass.
Stopping rsyslog is not the good way ( risk of loosing messages ).
I Know that I can use a file ( I use that often ) but rsyslog give function only to read environment variable.
You can modify rsyslog to store this flag in a mmap()'d file, so you can modify that file on the fly -- no overhead, no interruptions, 1 additional page in working set.
Team,
Hope you all are doing fine
I have one admin server which is being used dedicately to run cron jobs on hourly basis, fetching the details from Database which is in a different server.These cronjob are run on every hourly/5 minutes basis depending as per end user requirement.The script... (12 Replies)
Hi,
I currently use the ntpdate and date command to sync the internal clock source of my Solaris systems to the primary domain controller.
admin@myserver # ntpdate -d -u 192.168.???.???
14 Jan 17:42:02 ntpdate: ntpdate 3-5.93e+sun 03/06/05 23:16:45 (1.4)
transmit(192.168.???.???)... (2 Replies)
Hi,
I wrote a script which generates a mail automatically under certain condition. When i execute the script manually in unix the script is getting executed and the condition works accordingly and the mail is also generated. But when it is pu into cron the mail is not generated and the... (4 Replies)
Hi there!!!
Need your help in solving some tricky problems.
Since clock() as such is buggy on SUN OS 5 we have started using gettimeofday() in our RTOS applications based on Solaris 9.
The problems we actually encountered previously were - the applications kind of freeze/hang eternally on... (1 Reply)
Hi
We had a AIX box built last year but was set to the correct GMT time, but using DST time zone. In march this year the clocks went forward without issues. (if I remember a couple of weeks early due to the DST zone)
This year we decided to change the clock to the correct time zone before... (0 Replies)
Hey all,
i need a program to get the CPU ticks at certain points of my program. So, i thought about using the clock function, but i'm having a hard time figuring out how it really works. I wrote this simple program to try to understand it but it made me feel more confused:
#include <stdio.h>... (5 Replies)
Hey ppl, i was wonddering, in mandrake, how to get the clok to display the time in non-military format....hehe thank you im just tired of looking at 18:00 hehe thank you (2 Replies)