Thursday, June 10, 2010

Got a log full of "ACPI Error Method parse/execution failed" errors?

Well, I certainly did!

Actually I have seen the error on two of my machines and a lot of posts about it on the net. Here is how I got rid of the error spam:

First have a look at what clock options is available on your computer as that seems to be where the problem is:

I had hpet, acpi_pm, and tsc on one machine and only hpet and acpi_pm on the other. To stop the messege in the logs a option need to be added to the kernel. First try if it works out and then add it permanently. To try it out reboot and when you see the list of kernels press "c" to edit the kernel you want to boot with. Add clock=acpi_pm or one of the other options you saw earlier.

If everything works out and the error is gone then add it permanently:
Edit "/etc/defaults/grub" and add the kernel option you tested to all kernels:

The reason to do this instead of editing a single kernel is that then at every kernel update you have to re-add it.

Save and exit. Then update grub:

Hope it helps someone getting their logs back to normal ;-)

Wednesday, June 9, 2010

Allowing a specific user to run specific commands without giving them full sudo or root access

I was working on a web page that shows the status of a few different servers and was looking for a method to allow some servers/services to be managed from the web page without giving access to anything unnecessary.  I accomplished this by giving the web server permissions to run some specific sudo commands via the sudoers file.

(The sudoers file is where you allow a user to run stuff with the sudo command. It should always be edited with "sudo visudo".)

Here is what I came up with:

This will allow logged in user Username to run a command like "sudo /usr/sbin/service ServiceName stop" on the host HOSTNAME without entering a password. The * will allow anything to be added like start or stop.

There are some nice examples on how to use the sudoers files on sudo's homepage @