Can turning off the cpu without halting cause problems?
SlackwareThis Forum is for the discussion of Slackware Linux.
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.
Can turning off the cpu without halting cause problems?
Im going to build a "router" using a old 468 computer with slackware for another person, all this computer does is when you turn it on it connects to the internet and shares the connection with the LAN.
So can the person turn it off without having to halt it via SSH?? Will it cause any problems like screwing the data tree, or making the boot time slower?
Usually any filesystem has to now be unmounted properly to avoid problems. How often are they going to have to shut it off? Mine's been "up" for about a month (had a power outage).
As long as you use ext3 or reiserfs filesystems, turning off while running won't hurt the system. With ext2, it has to run fsck after rebooting, which takes forever.
Yes, use ext3. (or reiserfs, or xfs, but ext3 is probably simplest) I got exactly that and keep turning it off while running several times a day. No problems, ever. Speaking from experience, you probably have to look out for two problems: My CMOS memory battery died recently (after 10 years, maybe?) so it probably makes sense to change your battery now. Second is, most old computer will halt on keyboard errors, so you need to keep a keyboard connected, or do something creative.
Its likely to be shut down everynight before they stop using the internet or go to sleep, leaving it own forever isn't such a great idea because many crappy power supplies break if you leave it own for some months without turning it off.
I know about the keyboard problem with some of the older machines, they wont boot unless you have a keyboard, in that case im going to plug a keyboard in it.
hmmm I got a idea, since the machine is likely to have a keyboard, is there any way to make a script where whatever i press a key it halts the computer (without having to log in it)? that would solve the problem.
I think the problem would be solved by buying a router, they are $20 now.
But whatever works for you.
Also, no matter what FS you use, there is always a danger when powering off without halting and unmounting the file system.
I have lost power on ReiserFS systems and have had them unbootable after power returned.
Your only safe option would be to never mount the volumes RW in your boot scripts, or better yet, run the entire thing from a read-only Compact Flash card.
Originally posted by Necronomicom leaving it own forever isn't such a great idea because many crappy power supplies break if you leave it own for some months without turning it off.
Unless you replaced the one in that machine...old power supplies are much more reliable than newer ones. I have a Pentium 1 machine with a ~1994 power supply that runs for months on end with no failure. (Turned it off for other reasons)
echo 'Shutdown? (Y/N)'
read sure
case $sure in
"y" ) halt
esac
case $sure in
"Y" ) halt
esac
If you press the Y it'll shutdown, else it'll continue to boot, if you put this in rc.local the machine will boot (this includes all the init scripts), but it'll then wait until you press Y to shutdown or else to continue boot.
EDIT: A better script, this will shutdown if you press Y or y but also you can type some other letters, as long as there is a Y before pressing enter it will shutdown:
Code:
echo 'Shutdown? (Y/N)'
read sure
if echo "$sure" | grep -i "y"
then
halt
fi
A read only filesystem is the way to go here. A floppy bootable floppy system would be ideal, that's the way I did it with a 486 before. Three NICs, a keyboard, and a bootable FreeSco router distro on a floppy.
Originally posted by Shade A read only filesystem is the way to go here. A floppy bootable floppy system would be ideal, that's the way I did it with a 486 before. Three NICs, a keyboard, and a bootable FreeSco router distro on a floppy.
--Shade
Shade has a point about the read-only. Plus, there are a lot of micro "router" distros that you can use right out of the box. http://www.linuxrouter.org/ - Linux Router Project immediately comes to mind.
Well, the best way to handle shut down of machine would be so create a script that ping scans it's subnet every few minutes, and shuts itself down when the scans show that is is the only active computer.
That way, after all the other computers are off, it will turn itself off soon after.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.