General :: Catching The Hibernate Event?
Jun 7, 2010Is it possible to catch the power management events(hibarnate/standby/sleep)o the code(c++)?
View 2 RepliesIs it possible to catch the power management events(hibarnate/standby/sleep)o the code(c++)?
View 2 Repliesthis might be an interesting one for the bash scripting gurus. I seem to break my teeth on it. The mission:- do a dd over ssh to trasnfer an image to another host- capture the dd PID on the other side- send a USR1 kill signal to it- capture that output on the original host It goes wrong on the last part. This is what I have before that step:dd if=image.gz | gzip -d | ssh host2 "dd of=/dev/vg1/lv1" &PID=`ssh host2 ps aux |grep dd|grep lx05|awk '{ print $2 }'`when I do "ssh host2 kill -USR1 $PIDI get nice outputs to the screen. When I replace the first line with:dd if=image.gz | gzip -d | ssh host2 "dd of=/dev/vg1/l01 2>/tmp/output.txt" &the dd command seemd to die. I suspect a problem with the pipe, since this does work when executing locally on a host without piping.
View 4 Replies View Relatedi am dealing with this problemI have a function
function Une {
...
return $some_variable
[code]...
I've been trying to find a bug in this test script, but haven't been able to so far. I'm not lazy, I promise...just new to Bash so am having a hard time catching syntax errors. I call the script with the option -disableVenusBld, and it still prints "Starting build", which it shouldn't be doing right?
[Code]...
I've been debugging the following script all evening and am now stuck...this script is supposed to ssh to a router, pull interface conf, 'cut' 3 pieces of info, and then print the results of 2 as well as the 3rd (after running a ping cmd on the linux box):
SCRIPT_CODE
#! /bin/bash
lb1="0"
[code]....
I'm using pm-hibernate, and would like to reboot the machine after it's done hibernating, rather than having the machine turn off.Is there a way to do this with pm-hibernate, or any other Linux hibernate thing?
View 2 Replies View RelatedI have a Logitech Media Play mouse with many buttons. I'm using xbindkeys to create some shortcuts to programs e.g. firefox, gnome-terminal--these work wonderful. What I cannot figure out is how to get the buttons to work for the media player(Ubuntu>System>Keyboard Shortcuts>Sound). I set shortcuts using my win key and letters, hoping to use xbindkeys to send out a keystroke. I have tried to use xmacro but to no avail. xdotool was not helpful, I think it may be outdated(desktop/workspace functions did not work).
My preferred option would be to get mouse events to keystrokes working with xbindkeys and program x(x being whatever works); however, just getting my media buttons to interact with the media play is my ultimate goal.
I know in windows xp there is a registry key and an entry in the Plug and Play log file as well as maybe an event id, that is produced when a device (say usb) is plugged in. My question is, besides /var/log/ (messages?) Is there any other location that that information is stored in?
View 3 Replies View RelatedHow do I catch the output of split and redirect it to another directory?for example,if my working directory is 'Documents' and I split a file called text.one into 4 files of 100 lines each (xaa, xab, xac, xad), how would I get those split files to be written into 'Directory/subdirectory' instead of 'Directory'?And is it possible to rename those split files so that the split name is suffixed with the original file's name e.g instead of xaa, xab... can they be written as text.one.xaa, text.one.xab..?I've thought about using '>' to send the output to a new directory but it doesn't work; and I've thought about piping the results to another command but I don't know what that other command should be.
View 2 Replies View RelatedI'm working on an app that will authenticate user with a smartcard when the user inserts it in the card reader (this is on Red Hat 5.5). How do I detect a card has been inserted? Is there a daemon service I need to listen to and associated api to get notified etc? .
View 3 Replies View RelatedIs there a way to provide post-mount and pre-umount scripts in Linux?
I am trying to do some scripts on storage media when mounted and before umounting (eg, for syncing).
I'm trying to make sure that my laptop will suspend if I unplug it after the lid is already closed, and I believe that one way to accomplish this would be to simulate an ACPI lid event when the power adapter is plugged or unplugged. In order to do this, I need to find a command that will generate a fake ACPI lid event. Is there any such command?
View 1 Replies View RelatedI'm running FC10, with the sendmail that was part of it in Feb 09. Anyway, Up till now I've been using the user client to do spam filtering, But I'd like to start catching the spam at the sendmail level. What are my options today? I tried searching the forums and found a bunch of threads from 2001-2006, but I figured many of the ideas are now longer vaild.
View 2 Replies View RelatedSolving issues with signed and unsigned numbers in BASH.For a start, Yes, BASH is type independent � I know that. My problem lays in catching executables output into a BASH variable.My executables are not quite UNIX compatible, where returned values are 0 for OK, >0 ERROR. They return 0 for OK, >0 WARNING (only, so move on) and <0 ERROR (abort) instead.
Code:
// C++ BIN A
int main(){
[code]...
Is it possible to handle multiple signals in just one handler? I only know singal() catches one signal at a time
View 2 Replies View RelatedI followed this how to document [URL] to install postfix, Amavisd, SpamAssassin and ClamAV. My postfix installation is working fine and I can send and receive emails fine. However, it looks like SpamAssassin is not catching any emails. Emails do get passed over to Amavisd as I can see in the logs but ALL Messages comes out CLEAN without being tagged as spam.
As per the document, I did test by sending a test virus email
sendmail -i your-address@example.com < sample-virus-simple.txt.
This is caught and NOT let through so ClamAV is ok but when i send
sendmail -i your-address@example.com < sample-spam-GTUBE-junk.txt
it does get delievered without being detected as SPAM or tagged as SPAM.
As I said, I have followed the documentation dot by dot and hence do not have spamassassin starting up as a service but i guess amavisd starts it within itself as a module.
Also, my postfix version is the one that supports mysql virtual tables which I got from rpmforge.
Just got Ubuntu 9.10 and I'm liking it a lot, but my computer refuses to go into hibernate or suspend. I have a Dell M1530 but I don't really think it's a dell hardware issue because it's not just when I close the screen, it's also when I click suspend or hibernate from the menu.
View 2 Replies View Relatedi am using kubuntu and my laptop does not hibernate or even sleep whenever i close the lid of my laptop!! i have tried to configure the powersave but it is all in vain!!
When i close the lid,the screen goes blank and it deactivates everything including the mouse and the keyboard!
On a Debian system, there are packages called uswsusp and hibernate. The former contains a program named s2disk, the latter contains a program called hibernate. Superficially, these both do the same thing: the suspend the machine to disk. Usually, this works fine, but since I'm often using Debian testing and there are lots of changes in kernel and other packages (I assume), somethings this breaks. But then, when one of these programs doesn't work, sometimes the other works. Often, hibernate works when s2disk doesn't.annoyingly, however, the "Suspend" or "Hibernate" buttons in the graphical user interfaces (e.g., LXDE, KDE) appear to be wired up to the s2disk program, so when that breaks I have to use hibernate manually.
So, what is the difference between these packages? Interestingly, the hibernate package "recommends" uswsusp, but the package description says that it "smartly puts your computer to sleep ... using one of the various methods available in the kernel". So apparently it can fall back to something else when the s2disk method fails? And if hibernate is more powerful, why wouldn't the GUIs use it instead?
where do I define that my laptop should go hibernate or suspend when my battery has a certain percentage? Where do I define this percentage ?I see no such options under Power Management Preferences.
View 4 Replies View RelatedI have installed Fedora 15 Alpha with GNOME 3. Everything is working fine. However, I can't see any option to hibernate or shutdown.
In the top panel when I click my user name, I only have one option and that is to suspend. Normally I like to hibernate or shutdown. And I can't see any option of what to do when I close my netbook. Normally, I prefer to hibernate.
Put 'nix box to sleep from command line?
I found that the solution was to do: pmi action hibernate
But when I typed in that, it showed: Error org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.Hal was not provided by any .service files
I have fedora 13. What is the difference between suspend and resume? If I suspend, how do I turn on the pc? If I hibernate, how do I get out of hibernation?
View 3 Replies View RelatedI dual boot Ubuntu and Windows and sometimes I just want to switch between the partitions without loosing the state of the OS I was currently working with. Currently to do that I just hibernate that OS and, when the computer turns off, I restart it and select the correct partition.
I do not really want to have to press the on button again every time I want to switch between partitions. I figure that there must be a way to make the hibernate action restart instead of shutting down.
How do I make the hibernate action restart instead of shutting down on:
Windows, or Ubuntu
P.S. It is more important to me that I can do this in Ubuntu than Windows (because of the way I use the partitions) therefore if one answer says the Ubuntu way and the other says the Windows way then I will mark the Ubuntu one as the answer and give the Windows one an upvote and a big thankyou.
I have installed Ubuntu as wubi (next to windows 7). When I expect the computer to shut down (either to hibernate or as part of, you know, shutdown), it doesn't. All the programs end, I am logged out, but I still have a picture on the screen (ubuntu default picture).
View 7 Replies View RelatedWhy doesn't Hibernate work in Ubuntu 10.10?
I have tried to research the problem and suspect that the hibernation function is not a default function of the system. But how do I install it.
First of all let me introduce myself. My name is Rasheed and i am from UAE, after not having any reply from a week in Fedora's official forum i came across the linuxquestions through google and hoping to help others and resolve my issues as well with the help of experts here. So here is my problem what i am currently having. I am going through a serious issue right now. My laptop crashes when SUSPEND/HIBERNATE or unplugging the laptop's charger.
View 14 Replies View RelatedI am using ubuntu 9.10 and when i close the lid of the laptop it does not hibernate or suspend?
what do i do?
Currently running Slackware 13.37 64-bit on a notebook and finally have suspend/hibernate after realizing that USB devices, especially USB HDDs, need to be disconnected before suspend/hibernate can work. Problem is I have 2 USB HDDs that are connected to my notebook whenever the notebook is stationary for the extra storage so I'd like to create a script that would get invoked that would stop the suspend/hibernate process if certain partitions are mounted. I know what I would like to accomplish, but I have basic scripting knowledge so I was hoping to get some assistance.
1. script would basically store a user specified string containing devices that are non-USB, ie: NONUSB="/dev/sda /dev/sdb"
2. possibly use /etc/mtab to get a list of what is currently mounted and then remove lines containing whatever is specified in $NONUSB and store those values in $USB
3. run a for loop that executes 'umount' on each token in $USB
3a. stop suspend/hibernate process if 'umount' fails at any point
3b. if 'umount' passes then suspend/hibernate
I have been using Linux Mint with great success for about 5 months. The other day when I went to turn off my computer instead of selecting shut down, I accidentally clicked on "Hibernate". Now my computer will not turn on, even after a hard shut down. Nothing comes up, not even the BIOs screen. It did this once before and my Linux-guru ex was able to fix it, but I will be dammed if I remember what he did.
View 14 Replies View Related