Programming :: How To Properly Clean Up On Asynchronous Or Sudden Shutdown
Jun 6, 2010
I have an user space application that performs file I/O operations, when a SIGKILL is captured, some routines are done first to ensure that all I/O operations are completed before rebooting the application or system. My question is, this won't work if the power button is pressed or the power supply is disconnected, so there can be incomplete I/O operation or corrupted data written into the file, so is there a way to prevent data corruption or at least complete any ongoing operation when this scenario happens? Assuming there is at most 1 second before the power really went out, can I/O be still completed?' I'm running the application on a busybox 2.6.14 kernel on an embedded system board.
View 1 Replies
ADVERTISEMENT
Nov 9, 2010
I just did a clean reinstall of Ubuntu (10.04 --> 10.10). After the install, any time I do CPU intensive work, my PC is suddenly shutting down like it's overheating. Everything was working fine for months, and started having problems immediately after the reinstall. so this is not a problem with my hardware, and it's not a problem with my fans needing cleaning -- it's a problem with software. So please don't tell me "that sounds like overheating, clean your fans". Something is different in software-land between 10.04 and 10.10 that is causing this to happen.
I have checked my log files, and can't find anything related to overheating -- searches for things related to lm_sensors, "temp", and "thermal" are not turning up anything in the system logs (syslog, kern.log, or messages). I also looked at the logs around the times of the sudden shutdown, and couldn't find anything unusual. How can I diagnose this? I'd like to file a bug report, but since I can't find anything in the logs, I honestly have no idea how to go about providing useful information. Is there anything besides overheating that might be causing my laptop to suddenly shut off? (I am using a Gateway M-6888u laptop, btw)
View 3 Replies
View Related
Jan 17, 2011
I run Ubuntu 10.04 on a HP dv2000 laptop with 2GB RAM. I see a strange problem with my system. When running on battery and the level hits about 43% (+- 1%), the system shuts down suddenly. No warning and no information in logs either. Temperature of both cores are below 50 C. I have tried cleaning the dust withing the laptop chasis but no progress.
I have done quite some research on this and other forums but haven't found anybody else with similar problem.
View 1 Replies
View Related
Nov 9, 2010
I just did a clean reinstall of Ubuntu (10.04 --> 10.10). After the install, any time I do CPU intensive work, my PC is suddenly shutting down like it's overheating.Everything was working fine for months, and started having problems immediately after the reinstall. so this is not a problem with my hardware, and it's not a problem with my fans needing cleaning -- it's a problem with software. So please don't tell me "that sounds like overheating, clean your fans". Something is different in software-land between 10.04 and 10.10 that is causing this to happen -- I assure you that the upgrade did not magically fill my fans with cat hair.
I have checked my log files, and can't find anything related to overheating -- searches for things related to lm_sensors, "temp", and "thermal" are not turning up anything in the system logs (syslog, kern.log, or messages). I also looked at the logs around the times of the sudden shutdown, and couldn't find anything unusual.How can I diagnose this? I'd like to file a bug report, but since I can't find anything in the logs, I honestly have no idea how to go about providing useful information.Is there anything besides overheating that might be causing my laptop to suddenly shut off?
View 7 Replies
View Related
Dec 13, 2010
I am developing a I2C CDROM client driver. The CDROM firmware supports TOC information read through a I2C command. It sends the TOC information in burst ( Interrupts a GPIO pin when it is ready ) and my CPU does a I2C read to read the TOC. When the CDROM firmware finishes sending the last data burst , it informs my CPU that it is done with the TOC, by a flag in the last data burst. I would like to know, which is the most efficinet way I can send these TOC information to userspace?
View 4 Replies
View Related
Jan 20, 2010
I have been using this tip at URL.. to delete the temporary files created in /tmp for quite a few Fedora versions. But, I just found out that it does not work in F12. Is there are reason why it doesn't work?
You can put this into /etc/rc.d/init.d/syslog into the "stop)" section. This will clean up /tmp at every shutdown and keep your disk clean. Please note that you should not run this command when X-Windows is running.
View 7 Replies
View Related
May 13, 2011
Just did a clean 11.04 install, however, Ubuntu doesn't start properly, it usually stops when it gets to the purple screen, the screen with the word Ubuntu and a few red dots underneath it to show it is loading. The system usually stops there or stops before getting to that screen. I was able to start in the 'safe mode' though.
View 14 Replies
View Related
Nov 20, 2010
Did a clean minimal install of Testing in a Virtual Machine (VirtualBox).Login as root.Type "shutdown now".It starts shutting down, then says INIT: Sending processes the TERM signal Give root password for maintenance (or type Control-D to continue):If i press Control-D it goes back to a login prompt.Okay, i maybe missing a point since "shutdown -h now" gives the expected behaviour.Call me old fashioned but I think that a "shutdown now" should shutdown a system, and not effectively reboot the system. There is a reboot command for that.
View 3 Replies
View Related
Jun 13, 2010
I have a file server that has a raid array with a jfs file system attached. Whenever there is a power cut (quite frequently in our house), and the server is not shutdown cleanly, then the raid array is not automatically mounted since ubuntu doesn't know if the journal is clean. I have to then manually run fsck and remount the partition by hand which is a bit annoying. Basically, does anybody know if fsck can be setto run if a non-clean shutdown has been detected, or failing that, on every boot?
View 2 Replies
View Related
May 3, 2010
I've been having a bad problem with X freezing up (but not the whole system), and I hate continually performing unclean shutdowns with the power button.Will an Alt+SysRq+o shut down the system in a way that doesn't cause the loss of disk buffers? Obviously, whatever hasn't been saved to the buffer will be lost, but my concern extends to the buffers themselves.ext4 and autofsck make this less of an issue, but I hate the thought of unnecessary silent corruption until the freezing stops.
View 6 Replies
View Related
Oct 25, 2010
I have a very weird issue here. At work I have a machine that runs ubuntu 10.04.1 and whenever I do a "shutdown -h now" the system shutsdown for a few seconds and the comes back up again.
The system itself is a HP DC7900 SFF machine. It was the network setup along with wild flying magic packages that caused this.
View 2 Replies
View Related
Jul 9, 2010
I am unable to shutdown the ubuntu system properly. As i click the logout button, the desktop icons and taskbar and everything disappears and only i can see the wall paper... Then i hav to do a hard shutdown by pressing the power button...
View 2 Replies
View Related
Mar 25, 2010
I'm sure there's an underlying hardware problem for this... but I figured I'd start here as I do not know the specific hardware issue.
I'm in Ubuntu 9.10 (Ubuntu Studio actually) and my computer will not shut down properly. I get the splash, then a black screen, then something like #terminating processes, #closing connections, #blah blah blah, #will now halt(or will now restart if rebooting)
View 10 Replies
View Related
Aug 17, 2010
I have noticed my server do not shutdown properly sometimes.It should do it with this command in a cron with root session /sbin/shutdown -h now
View 3 Replies
View Related
Dec 9, 2010
I have an mysql innodb ~ 20gigs. Normally shutting down mysql (service mysql stop) takes a few seconds. When I reboot Ubuntu with the reboot or shutdown command it just reboots it super fast without mysql logging (/usr/sbin/mysqld: Shutdown complete) Also during this shutdown the following is failed: umount2: device or resource busy /data: device is busy.
mysql is setup to read from /data . Why is ubuntu not waiting for mysql to properly shutdown before unmounting the filesystem and rebooting?
View 1 Replies
View Related
Jul 1, 2010
I just installed apt-get hibernate and when my computer shuts down, it will go to a recovery menu. I have to end up killing the machine.
Also when I try to hibernate the machine this error msg will appear: hibernate:Warning: Tuxonice binary signature file not found.
How should I rectify this error?
View 9 Replies
View Related
May 19, 2015
I know the problem has been partly solved in this old thread [URL] .....
Now we have Jessie as stable, yet LXDE doesn't shutdown properly:
On the same computers, Wheezy LXDE shut down very fast
I installed Jessie from the netinstall image.
On a 2007 computer, it's like the old days with a Pentium II running some version of Puppy Linux or Slitaz. The system shuts down after a while but the computer remains on.
On a 2013 laptop, I added the line init=/bin/systemd in the Grub default file as advised on the old thread above. The laptop shuts down after a while, the system first, then the hard disk goes to sleep, then all the leds are off.
If I run the magic command, the computer shutdowns in a breeze, perhaps even quicker than good old Wheezy:
Code: Select all# systemctl poweroff
Now, is this still a systemd bug? Doesn't look like it since the systemctl command works. Is it an LXDE bug? Looks like it in a way - if the LXDE shutdown button enabled the systemctl poweroff command, I suppose the button would work?
Is there a way to make the LXDE shutdown button run the systemctl poweroff command?
I'm glad Wheezy is still with us because I wouldn't install Jessie for newbies — they'd think shutdown (through clicking on a button) is even worse than in Windows.
View 2 Replies
View Related
May 2, 2011
The startup and shutdown displays are a series of vertical black and white lines, and the text displayed on them appears as more or less white blobs. Otherwise, the displays when 11.04 is running are fine, but this startup looks so naff it would be nice to change it so that the diplays can be read. I would hate to demonstrate Ubuntu to someone and have to explain such a display.
View 7 Replies
View Related
Jan 14, 2010
When i use the shutdown-command in the terminal as root, it nearly works. It starts to shut down, and it looks like all programs and the kernels shuts down. I end up with a black screen, sometimes with the ubuntu-logo on, but it never powers off. I have to force it off by holding the power button. When i use the graphical interface to shut it down, it works perfectly. The poweroff-command works without problem too.
Here is the command i use:
Code:
View 4 Replies
View Related
Mar 29, 2010
I installed Mythbuntu 9.04 about 9 months to a year ago and (for the most part) I haven't had any problems with mythwelcome, automatic shutdown or the system clock. The "for the most part" relates to the fact that the clock on mythbuntu has always been 4 minutes fast. Then, just last week, the system started acting up - for some reason the system clock changed to 8-10 minutes fast (6 minutes faster than it was previously). To fix this problem, I have tried manually setting the "time and date" setting, and I have also tried setting the "time and date" setting to sync with an internet server. Lastly, I tried changing the system time through the motherboard bios. In each situation, mythwelcome would initially start up with the correct time. Then, several seconds later, the time shown in mythwelcome would change to being 4 minutes fast (as I described above). The time would also be 4 minutes fast when I enter the frontend.
I was willing to live with this, but the weird part is that when I start the system now (assuming I don't have any programs scheduled to record), mythwelcome boots up fine and I see the indication that "MythTV is idel and will shutdown in XXX seconds". Then, it flashes to "MythTV is idle" - like it used to; except now, it doesn't flash back to the countdown for shutting down mythtv. One time when I started the system when I was adjusting the time as mentioned above, I noticed that mythwelcome went to the "MythTV is idle" around the same time it changed the clock to 4 minutes fast - I think there is definitely a correlation here.
I checked out all the settings and nothing else has been changed that would otherwise affect MythTV from shutting itself down. The other interesting part is that I can get the shutdown countdown back if I go to "Utilities / Setup", "Setup", and "Mythbuntu". In the popup screen I choose "MythTV Configuration" and select "Launch MythTV Setup". I get a popup box that says that the mythbackend must be closed (as expected). Then I immediately exit mythtv-setup and the system runs "mythfilldatabase". I exit the Mythbuntu Control Centre and exit the frontend. When I get back to mythwelcome, the shutdown countdown comes back.
View 1 Replies
View Related
Jan 24, 2010
What is the basic difference between 'synchronous' and 'asynchronous' io in the linux/unix platform ? And in Linux RHEL5 and AIX 5.3 / 6.1, How can I measure that my server support either 'asynchronous' or 'synchronous' I/O ?
View 1 Replies
View Related
Jul 24, 2011
In a few months I am gonna be starting a website that handles credit card information.
A requirement of my servers is that they be fully self-maintaining.
By this is mean that they will download their own updates, restart them-self, and switch them-self back on after general house power failure (black out).
Is there a way in Linux to make the computer automatically reboot itself after download and installing an update (if it needs to). My Linux uses the apt package system, with Synaptic Package Manager/Update Manager.
Now here is another problem I found. When a customer has logged into my site, my computer won't register them as logged in when they've rebooted? Like, its going to issue them new cookies? Credit card transaction process will be have to be restarted?
What if I build two identical server running in sync with each other... sort of like RAID mirror.. and they both download and install updates, once their both ready to reboot. Computer 1 will reboot. On successful reboot, System 1 alerts System 2 that it successfully reboot and that System 2 may now reboot. This way the customers experience is not interrupted.
View 2 Replies
View Related
Jan 13, 2010
I am looking for a script that renames all MP3 files (and maybe its corresponding tags) of a specific folder and its subfolders. I want to just rename the file name, so that only the first letter is capitalized, and the first letter that stand behind a "-" (Regard! An empty slot is not a letter!). For examle:
[code]...
If it is possible, I want to do the same with the IDtag. E.g in the name of the album: from The Mating Game to The mating game. The lyric, delete, and the cover too. how to do the first with pyRenamer?
View 15 Replies
View Related
Dec 18, 2010
I have problem with my printer HP Deskjet D1460. My printer is configured and works. When I send a file on the print, the printer clings a sheet of paper and starts to print, but a paper as was clean so clean and remains, after printing.
View 2 Replies
View Related
Oct 11, 2010
I configured cron to clean my /tmp directory, should I also add other locations to clean and especially /var/tmp.
View 4 Replies
View Related
Apr 14, 2011
I've written an Expect script that assists with change management on Cisco devices. The script creates log files for pre-change, the change itself, and post-change. Each log and its commands is triggered by a ! command. For example:
Code:
./dochange.exp hostname
<script spawns bash, user SSHes to hostname>
!PRE
[code]....
All of this works fine. My big hair-pulling hiccup is that the resulting log files are filled with raw backspace characters! I am using log_file to log the output from the script. I stop and restart logging with a new file when needed. However, the log files are pretty much unusable. After doing some research, it looks like log_file sends output to the file in real-time, unbuffered. When I hit a key, it's immediately sent to the log. What I would like is for only the resulting string to go to the log. If I start to type 'reload' and instead type 'show run', I don't want 'reload' to be listed in the log at all.
View 1 Replies
View Related
Feb 4, 2010
Is there any difference between apt-get clean and aptitude clean? Do they both remove the same caches? Should I know any other commands for cleaning up wasted space on my ubuntu laptop?
View 1 Replies
View Related
Mar 26, 2011
I wrote a C program using Pthreads to compute the product of 2 matrices. Each element in the product matrix is computed in a separate thread. Eg: Thread (i,j) computes the element C[i][j] of the matrix C, where C=A*B. A is m*n, B is n*p, C is m*p. m,n,p are given as command-line arguments. A and B are initialized to random values from 1 to 10, while all elements of C are initialized to -1.But some threads do not get their arguments (i,j) correctly. So some elements C[i][j] still remain as -1, even after the program is over. My OS is Ubuntu 10.10 (Maverick Meerkat) 32-bit.I ran the program on another computer and it worked correctly. Is it due to a problem in the Pthreads library in my OS? Please help me. I have attached the source code.
View 3 Replies
View Related
Jun 8, 2011
I'm developping a C# app in Windows using VS2010. It has one form and communicates as a client with a server.A receive thread displays incoming data while buttons and a timer send data. All workingThe form has a button that calls the below method to disconnect from the server.
Code:
public bool disconnect()
{
[code]...
View 2 Replies
View Related
Feb 19, 2011
I have a webpage in html that uses <frameset> tag. One of the frames is a Table of Contents (toc.htm) that lists a series of images. The other frame is called 'canvas.htm'. My framset is laid out as follows:
<frameset rows="20%, 80%">
<frame src="./banner_sp.htm" ></frame>
<frameset cols="15, 85">
<frame name="toc" src="./toc.htm" ></frame>
[Code]....
The frameset is created properly and I can load the images manually (i.e. I can access the images from my browser and/or image editing tool). The problem comes when I attempt to access the images from the toc.htm frame. Instead of opening the image in the canvas.htm frame, a new window is displayed in my browser, instead of the image being displayed in the target window (canvas.htm). This happens on all of my browsers (firefox, safari, IE7/8 and Opera) on Windows, debian-linux and OS X 10.5/10.6.
If I change my src attribute (in the canvas frame) to toc.htm, I see the Table of Contents (toc.htm) displayed side-by-side until I click on the first drawing in the list. At this point, the frame 'behaves' half-arsed the way I want it to. I have searched on google till I am blue(er) in the face with no luck.
View 3 Replies
View Related