Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
We are using an application to send the bulk mails. Need to start/stop the application manually. But we don't have any log files. Could you please advise is it possible to create a log file for any particular application through script? That is who is starting/stoping the application and that one has to capture in that log file. Please check and advise.
Does this application have not got any log file of its own. Instead of creating a script I would suggest that you allow stop / start of this application via sudo. You can then have sudo.log to monitor who is starting / stopping / restarting this application.
Make sure that users are not allowed to restart the application without using sudo.
Hi,
1. We dont have sudo option for the start/stop the script.
2. It doesn't have any log file of its own.
Sometimes the application will stop automatically or someone stop it. Then we'll get an alert to start the applciation and Client will ask the reason how it got stopped. Without log file we are not able to find the "Root Cause". If the script is running to capture to the logs for that applcation, then it will help us to find the Root Cause easily.
"For Example: In IBM Websphere we have a log file. It will throw all types of Errors. With the help of that we can easily find the Root Cause." Sameway is there any possible way to create a script to find the results. I'm new to Linux. So please help me.
By script you cannot do logging. I mean you can have a script to check if application is running or not. You can have a script to track when the application went down but what you are looking for is detailed log which I don't think is possible via script.
By default application should have the log if it does not have a log then atleast application should have option to send warnings or errors to standard system log.
You have to check with the team who developed this application. Ask them if they have any switch or option to generate the log for the application.
Hi T3RM1NVT0R,
Thanks for breif explanation. Could you please provide the script which is used to track when the application went down. Might it will helpful for me.
We aren't going to write your scripts for you...see the "Question Guidelines" link in my posting signature. If you want your application to log errors, then YOU are going to have to modify it to do so. We can't change your code for you. We will be happy to HELP you if you get stuck, so post what you have written/tried, and give us complete details, and we can assist.
Also, you provide no real details..you say "an application", but don't tell us which one. You don't say what version/distro of Linux, what kind of environment, etc. Also, you're probably not going to find a lot of people willing to help someone shovel out bulk emails...no one likes spam.
Thanks for breif explanation. Could you please provide the script which is used to track when the application went down. Might it will helpful for me.
Thanks,
Srikanth.V
There is no script that I have. Basically what I was talking about is a watchdog script which you can create yourself. As TB0ne said we will not write script for you. It is something you have to come up with and if you are stuck somewhere then we are here to assist.
What you should be looking at is a script which can check the exit status of the command used to check the script status. You can configure the script to do that every second and you can add it to crontab to run every minute. This pointer should be good enough to give you an idea on how you have to write it.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.