LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Laptop and Netbook
User Name
Password
Linux - Laptop and Netbook Having a problem installing or configuring Linux on your laptop? Need help running Linux on your netbook? This forum is for you. This forum is for any topics relating to Linux and either traditional laptops or netbooks (such as the Asus EEE PC, Everex CloudBook or MSI Wind).

Notices


Reply
  Search this Thread
Old 06-15-2005, 06:44 AM   #1
mngmd
Member
 
Registered: Jan 2005
Location: Philadelphia, PA
Distribution: ubuntu
Posts: 68

Rep: Reputation: 15
ACPI controls as user


I've finally got my laptop (Compaq N600c) to work with ACPI to get working suspend and hibernate.
However, I can only do that as root.

For example,

#!/bin/sh
# /etc/acpi/sleepbtn.sh
# Initiates a shutdown when the power putton has been pressed.

LOGGER="/usr/bin/logger -t ACPID"
/usr/sbin/hibernate
#echo 4 > /proc/acpi/sleep
$LOGGER "Sleep button pressed"

Nothing happens when I press the button as a user. In a console,
hibernate: You need to run this as root.
Nothing happens if I type sudo hibernate.

I can hibernate through the klaptop icon as a user though.

I know its something relatively simple...
 
Old 06-16-2005, 08:09 AM   #2
happen23
LQ Newbie
 
Registered: May 2004
Location: China
Distribution: Ubuntu
Posts: 13

Rep: Reputation: 0
you can make it by sudo

run visudo to edit the sudoers file,its format use

BNF,and that is a list intricate.
so you'd better run
man 5 sudoers
to learn the format

last,rum sbin cmd liske this

sudo /sbin/poweroff
 
Old 06-16-2005, 02:53 PM   #3
Half_Elf
LQ Guru
 
Registered: Sep 2001
Location: Montreal, Canada
Distribution: Slackware; Debian; Gentoo...
Posts: 2,163

Rep: Reputation: 46
for some "simple" script, you could also set the uid (chmod 4755) bit and make sure the script is owned by root, it will cause the script to execute with root right. However it is not very "secure", it's better not use it on a server
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Remote controls maroonbaboon LinuxQuestions.org Member Success Stories 1 01-14-2008 04:45 PM
Xined - what it controls Swakoo Linux - General 4 10-19-2005 12:48 PM
User and File access controls questions sureshp1980 Linux - General 6 09-26-2003 04:12 PM
kernel 2.4.20 & acpi-20021212-2.4.20.diff => no /proc/acpi Tinkster Linux - Software 5 03-24-2003 01:56 PM
keyboard controls butthead Linux - Security 2 11-06-2001 08:39 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Laptop and Netbook

All times are GMT -5. The time now is 04:25 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration