ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
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.
I am doing a program in which I want to catch events when system shutdowns, hibernated, suspended, user logged out and when user logged in(gnome and sh in both).
I successfully catched shutdown event by placing a sript in runlevel 0 and 6.. But unable to catch hibernate, suspend , login and log out events.
I know we can use lastlog to get login records.. but It gives database of login only..
so please tel me how can i catch these signals.. suggest a c program or shell script to do this..
I am doing a program in which I want to catch events when system shutdowns, hibernated, suspended, user logged out and when user logged in(gnome and sh in both).
I successfully catched shutdown event by placing a sript in runlevel 0 and 6.. But unable to catch hibernate, suspend , login and log out events.
I know we can use lastlog to get login records.. but It gives database of login only..
so please tel me how can i catch these signals.. suggest a c program or shell script to do this..
The reason is: that naveen is my friend and he is working along with me. Since I didnot get any reply for my question, I asked him to post the same in his blog..
The reason is: that naveen is my friend and he is working along with me. Since I didnot get any reply for my question, I asked him to post the same in his blog..
Ok.. sorry again..
Please send the answers..
Sorry, that's a lie.
Your 'friend' Naveen posted at 6:57, and your post was at 7:22. So you asked your 'friend' to post the same question, BEFORE you did?? And even if it was the other way around, too bad...you don't get an answer within 30 minutes, so you post again??
You and your 'friend', should Google for "linux hibernate event". Things come up that you can look at, one of them is even a shell script.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.