I'm trying to figure out why the perl process we have running in a loop isn't working.
Basically its setup to read our queue from Amazon SQS with the results getting inserted into the db.
We are using EC2 for video transcoding and once the conversion takes place our web server hosted outside of Amazon has a perl process that reads SQS.
I'm not a dev but I think I can find the problem if given some suggestions on how to test. I was trying to locate the "aws-daemon" log but wasn't able to find it in /var/log. I see that first line below states to exit if theres an INT flag, but I'm not sure what that means, and if it did set that flag does it mean theres a problem that is still existing somewhere preventing this process from working.
I've rebooted the server, and launched a new ec2 instance but other than that I don't know enough on how to kill or restart a process or whether thats the way to do it. I know there is stuff sitting in the queue waiting for this process to pull it and insert it into the db. Any help would be greatly appreciated.
The reason you don't get a log file in /var/log/ is that Log::Log4perl::easy_init will only send messages to stdout/stderr, both of which are redirect to /tmp/awsd in daemonize(). Check that file for any error messages.
The $SIG{INT} construct tells the script what to do should it receive a SIGINT (usually via kill -2 <pid>). It will set the exit variable, which is checked by the loop, which then will exit.
The reason you don't get a log file in /var/log/ is that Log::Log4perl::easy_init will only send messages to stdout/stderr, both of which are redirect to /tmp/awsd in daemonize(). Check that file for any error messages.
The $SIG{INT} construct tells the script what to do should it receive a SIGINT (usually via kill -2 <pid>). It will set the exit variable, which is checked by the loop, which then will exit.
I'm not finding any /tmp/awsd directory currently.
I have a terminal output text file I saved back in June that does show the /tmp/awsd but now the directory shows totally different files
right now the /tmp has
.ICE-unix/ queue-log s3-bash/ .webmin/ .X11-unix/
and in june the /tmp was
awsd php-www.log queue-log s3-bash
---------- Post updated at 01:18 PM ---------- Previous update was at 01:17 PM ----------
So aside from the logs is there something that can be done to execute the process from the cmd line, do I need the pid in order to do that? Any help is really appreciated.
I might recommend a minor rewrite of the sub daemonize function to include some reporting (as well as identifying the correct files that can't be written to...).
Change this around such that:
This will let you know what it sees BEFORE you exit - it might help you to debug.
You might want to read up on the perl module "Log::Log4perl" - it might have some information that would make this more clear.
The /tmp/aswd file was probably deleted when you rebooted, since most Linux distributions will clean up /tmp on boot.
To start the daemon: /path/to/aws-daemon
To stop the daemon:
Generally, when a daemon has to be restarted, it isn't necessary to reboot the whole server (as opposed to some services in Windows)
The /tmp/aswd file was probably deleted when you rebooted, since most Linux distributions will clean up /tmp on boot.
To start the daemon: /path/to/aws-daemon
To stop the daemon:
Generally, when a daemon has to be restarted, it isn't necessary to reboot the whole server (as opposed to some services in Windows)
It gave an error:
Can't locate Platform.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.8.8 /usr/local/share/perl/5.8.8 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/local/lib/site_perl .) at /path/to/aws-daemon line 9.
BEGIN failed--compilation aborted at /path/to/aws-daemon line 9.
Team,
I have multiple batchjobs running in VM, if I do ps -ef |grep java or tomcat I am getting multiple process list.
How do I get my exact tomcat process running and that is unique? via shell script? (4 Replies)
Hi Experts,
I am facing one problem here which is one process always stuck in running state which causes the other similar process to sleep state . This causes my system in hanged state.
On doing cat /proc/<pid>wchan showing the "__init_begin" in the output.
Can you please help me here... (6 Replies)
Hi Experts,
I am facing one problem here which is one process always stuck in running state which causes the other similar process to sleep state . This causes my system in hanged state.
On doing cat /proc/<pid>wchan showing the "__init_begin" in the output.
Can you please help me here... (0 Replies)
Hi, I have written a script that allows me to repetitively play a music file $N times, which is specified through user input. However, if I want to exit the script before it has finished looping $N times, if I use CTRL+c, I have to CTRL+c however many times are left in order to complete the loop.... (9 Replies)
X Window isn't working.
When I ran startx I got an error message as shown in file attachment xwndow.png
Accordingly, I removed /tmp/.X0-lock as reflecting in the attchment.
Then again I ran the command and 2 more commands (shown in the attachment xwndow1.png) but they failed too.
Any... (2 Replies)
Hi Gurus,
Could you please help me to create a shell script that will be started by a cron job once every night at 24.00 h (that should bee easy:))
The shell script should control every 30 seconds the name of a process, and when the process doesn't run anymore it should execute a few further... (12 Replies)
Hello all,
I would be happy if any one could help me with a shell script that would determine all the processes running on a Unix server and post a mail if any of the process is not running or aborted.
Thanks in advance
Regards,
pradeep kulkarni.
:mad: (13 Replies)
Hi,
I got a simple script working to check if a process is running and then email if it is not running anymore. My scenario is that I need to make sure the process is always running so instead of running the below script via cron I think it is better to a have a looping script to check... (12 Replies)
Hi All,
I am new to perl and have been trying to write a short script to check a process.Though i havent reached to the stage where i can match the output.
I am trying to pass a variable x with value /opt/RGw/csbp-base/CSBP_BAT.01.00.05/csbp_BAT.01.00.05.jar
and then pass another variable... (2 Replies)
last week i started learning perl, so have limited skill and knowledge.
why isn't 'die' being called and the script exiting before the 'directory created' line?
if (! -d "$logdir") {
system "mkdir -p $logdir" || die print "\nERROR: release log directory creation failed - $logdir: $!\n";... (4 Replies)