LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Need help with shutdown & APM (https://www.linuxquestions.org/questions/slackware-14/need-help-with-shutdown-and-apm-80760/)

CodeWarrior 08-10-2003 06:36 PM

Need help with shutdown & APM
 
I have the typical problem of when I use the shutdown command I get the system to shutdown but my PC does not shutoff on its own. I have searched the forum for this topic and found that I need the APM module loaded in order to get this to work. Therefore I tried modprobe apm and received an error message saying that the apm.o module can't be found. SO it looks like I don't have the apm module. I tried lookin on FreshMeat for the apm source thinking I would try to get it an compile the module myself and then insert it into the running kernel, but I didn't find the source. I also tried uncommenting the line for the APM in the rc.modules file with no benefit. What do you guys think I should do? How can I get this working?

utopicdog 08-10-2003 07:33 PM

yep, I had this problem.,
first try 'halt' when logged in as root. if your kernel has apm support it should shut down nicely.
if it doesn't try compiling a kernel with apm activated (modules or builtin), boot that kernel and retry.
If you have a distribution like SuSE this may mean that your soundcard, modem etc stops working so remeber to check the 'enable version signing' in the modules section of menuconfig for later work.
there is a file somewhere that tells the kernel what to do on ctrl+alt+del, and another which says who can do ctrl+alt+del, if you can't or don't want to log in as root your problem lies here and I cannot help you at present.

good luck.

Azmeen 08-10-2003 07:58 PM

Check your modules.conf file and uncomment the line which loads the apm module. I can't actually check it out for you now because I'm at work now (100% Windows hell :p).

Noryungi 08-11-2003 04:01 AM

[See Azmeen post]

On my laptop, the correct file to edit is, if I remember well, the "/etc/rc.d/rc.modules". There should be a line in this file with the APM module. Un-comment it and restart your machine. Do a "ps - faxu | grep apm" as "root" to check you do have the "apmd" daemon.

Then, doing a "shutdown" or a "halt" as root will stop your computer properly.

Doing a "apm --suspend" will put your machine to sleep.

Hope this helps! :D

CodeWarrior 08-13-2003 09:03 PM

Thanks for the reply's but let me clarify...

When I shutdown(turn off) my pc I use the command
shutdown -h now
Is this what you guys mean when you say the "halt" command?


I have already tried uncommenting the line in rc.modules that mentions the apm and tried to do the shutdown command from above with no change in behavior.

I haven't taken a look at the modules.conf file, I will uncomment the apm line in there and let you guys know how it went.

Azmeen 08-14-2003 03:12 AM

Then compile your kernel with apm support via modules... Or to totally save you from future headaches, just compile your kernel with apm support built in.

CodeWarrior 08-14-2003 08:36 PM

Quote:

Originally posted by Azmeen
Then compile your kernel with apm support via modules... Or to totally save you from future headaches, just compile your kernel with apm support built in.
Well first there is nothing in the modules.conf file to uncomment. Second that was my plan when I first posted this. I don't want to recompile the kernel right now but I will in the future as I learn more about Linux. What I would like to do is compile the apm module and include it in the running kernel. But if I don't have the source code for it I can't compile it. Do you know where I might get the source code for it so I can compile it into a module and insert it in my kernel?

Azmeen 08-15-2003 06:04 AM

Quote:

Originally posted by CodeWarrior
Well first there is nothing in the modules.conf file to uncomment. Second that was my plan when I first posted this. I don't want to recompile the kernel right now but I will in the future as I learn more about Linux. What I would like to do is compile the apm module and include it in the running kernel. But if I don't have the source code for it I can't compile it. Do you know where I might get the source code for it so I can compile it into a module and insert it in my kernel?
apm support is a feature of the linux kernel, and the sources for it are always included in every kernel release, so you do not actually have to get a separate source for it in order to compile it as a module.

I believe you have never compiled a kernel before, I suggest you get a stable kernel (2.4.21) release from http://kernel.org and read the kernel compiling guide to get you started. And no matter how hard people say it is... believe me, it's really not so hard, you just got to know your hardware.

But before you actually compile your kernel, please answer this one question for me... what do you get when running modprobe apm as root?

figadiablo 08-15-2003 06:40 AM

The apm should be available as a module as soon as you install your distro. Like Azmeen said, just typing modprobe apm should do the trick and load the module. Like others have said, you should be able to just edit the /etc/rc.d/rc.modules file. Now what is weird is that modprobe, you said it told you that the apm.o was not found. Maybe its loaded already. Do a lsmod and see if the apm module is listed. If it is then its already loaded, but I doubt it. Anyways you also said that there is nothing in the rc.modules to uncomment. Does this mean that it is totally blank, or that you didn't find the apm section? Humm, give more details please.

Good luck
Figa

yocompia 08-15-2003 11:36 AM

i hate to be a wanker and just post something related to the original question, but i have this same problem and when i try to insert the apm module it gives me grief. more specifically, it logs the following to messages:

Aug 15 16:26:42 darkstar kernel: apm: BIOS version 1.2 Flags 0x03 (Driver version 1.16)
Aug 15 16:26:42 darkstar kernel: apm: disabled - APM is not SMP safe.

i am running SMPs, so anybody got suggestions?

thx,
y-p

CodeWarrior 08-15-2003 03:21 PM

Quote:

Originally posted by figadiablo
The apm should be available as a module as soon as you install your distro. Like Azmeen said, just typing modprobe apm should do the trick and load the module. Like others have said, you should be able to just edit the /etc/rc.d/rc.modules file. Now what is weird is that modprobe, you said it told you that the apm.o was not found. Maybe its loaded already. Do a lsmod and see if the apm module is listed. If it is then its already loaded, but I doubt it. Anyways you also said that there is nothing in the rc.modules to uncomment. Does this mean that it is totally blank, or that you didn't find the apm section? Humm, give more details please.

Good luck
Figa

What I get when I run lsmod:

Module Size Used by Not tainted
parport_pc 14724 1 (autoclean)
lp 6752 0 (autoclean)
parport 23264 1 (autoclean) [parport_pc lp]
usb-storage 60116 0 (unused)
uhci 24560 0 (unused)
ehci-hcd 14632 0 (unused)
usbcore 58144 1 [usb-storage uhci ehci-hcd]
i810_rng 2624 0 (unused)
i810-tco 3088 0 (unused)
8139too 15272 0 (unused)
mii 2240 0 [8139too]
snd-emu10k1 59316 0 (unused)
snd-pcm 55968 0 [snd-emu10k1]
snd-timer 13316 0 [snd-pcm]
snd-hwdep 4672 0 [snd-emu10k1]
snd-util-mem 1136 0 [snd-emu10k1]
snd-page-alloc 4732 0 [snd-emu10k1 snd-pcm]
snd-rawmidi 12480 0 [snd-emu10k1]
snd-seq-device 3904 0 [snd-emu10k1 snd-rawmidi]
snd-ac97-codec 36104 0 [snd-emu10k1]
snd 27364 0 [snd-emu10k1 snd-pcm snd-timer snd-hwdep snd-util-mem snd-rawmidi snd-seq-device snd-ac97-codec]
soundcore 3332 2 [snd]
emu10k1-gp 1352 0 (unused)
gameport 1452 0 [emu10k1-gp]
pcmcia_core 38112 0
ide-scsi 8048 0



What I get when I run modprobe apm:

/lib/modules/2.4.20/kernel/arch/i386/kernel/apm.o.gz: init_module: no such device
/lib/modules/2.4.20/kernel/arch/i386/kernel/apm.o.gz: Hint: insmod errors can be caused by incorrect module parameters, including invalid IO or IRQ parameters.
You may find more information in syslog or the output from dmesg
/lib/modules/2.4.20/kernel/arch/i386/kernel/apm.o.gz: insmod /lib/modules/2.4.20/kernel/arch/i386/kernel/apm.o.gz failed
/lib/modules/2.4.20/kernel/arch/i386/kernel/apm.o.gz: insmod apm failed



Let me make some things clear:
1.) I don't want to recompile the whole kernel right now. If I can just compile a module and insert it that would be great. The kernel complilation is a project for another time ;)

2.) I found the apm line to uncomment in the rc.modules just fine, but nothing changed when I did that. It was the modules.conf that was empty(nothing in it).

3.) So you are saying that when I installed the kernel I should have the apm module. Do you think it is missplaced somewhere in my directories?

4.) I do have the kernel source installed as a Slackware package. Maybe I can grab the apm code and compile it into a module?

hecresper 08-15-2003 05:41 PM

Having APM support in the kernel or having the module available to load at will it's all good. The only thing no one has mentioned here is that the BIOS has to have Power Management enabled. On a default Slackware 9.0 installation, all I had to do was uncomment the /sbin/modprobe apm line in rc.modules and enable Power Management in the BIOS. The BIOS setting always comes back to hunt me every once in a while though.

CodeWarrior 08-16-2003 09:10 PM

Quote:

Originally posted by hecresper
Having APM support in the kernel or having the module available to load at will it's all good. The only thing no one has mentioned here is that the BIOS has to have Power Management enabled. On a default Slackware 9.0 installation, all I had to do was uncomment the /sbin/modprobe apm line in rc.modules and enable Power Management in the BIOS. The BIOS setting always comes back to hunt me every once in a while though.
Ok, I will try to see if I can enable the Power Management and let you guys know how things are going. I don't think my BIOS had that option, but I will try and find it.

Trebor 08-17-2003 09:28 AM

Hi

Thanks for your replies

As a newbie am have trouble understanding some of your replies

Have checked my /ertc folder but have no module folder inside it and so what do I do now ???

Thanks:confused:

CodeWarrior 08-17-2003 07:56 PM

Alright guys I looked in my bios. There was a section on Power and all that was in there were these 2 things:

1.) Suspend Mode. I have it currently set to S3. Other possible value is S1.

2.) Restore on AC/Power Loss. I have it currently set to stay off. Other possible values include Stay on and return to previous state.

I did not see anything that said "power management" specifically.

Any advice?:scratch:


All times are GMT -5. The time now is 11:30 PM.