Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Other Things Gentoo
  • Search

ivman + sudo

Still need help with Gentoo, and your question doesn't fit in the above forums? Here is your last bastion of hope.
Post Reply
Advanced search
3 posts • Page 1 of 1
Author
Message
wizardofos
Apprentice
Apprentice
User avatar
Posts: 201
Joined: Tue Jul 20, 2004 12:39 pm

ivman + sudo

  • Quote

Post by wizardofos » Fri Jul 08, 2005 4:16 pm

Hi

I've got Ivman installed to manage my system's HAL events, such as hardware plugging, media changing and ACPI.
I want Ivman to be able to write "ondemand" in my /sys/devices/system/cpu/cpu0/scaling_governor when I plug out the AC_Adapter of my laptop.
Manually I do it like this: "echo ondemand > ...". But I don't know how to write this command in /etc/sudoers.

greetings
fabian
Top
nightfrost
Apprentice
Apprentice
Posts: 293
Joined: Tue Dec 07, 2004 10:56 am
Location: Sweden

  • Quote

Post by nightfrost » Thu Jul 14, 2005 11:00 am

Would you really need to add that to sudo if you define it in the system wide config file? If you define it there, then it will be run with root privilieges I would guess.

May I ask you how you've defined the acpi-stuff - maybe you can post your config file? thanks.
Top
wizardofos
Apprentice
Apprentice
User avatar
Posts: 201
Joined: Tue Jul 20, 2004 12:39 pm

  • Quote

Post by wizardofos » Fri Jul 15, 2005 1:41 pm

No, cause my systemwide IVMan runs with the privileges of 'ivman', a user added by portage. (btw: why does portage that?)

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<ivm:PropertiesConfig version="0.1" xmlns:ivm="http://www.eikke.com/ivm">

    <ivm:Option name="checkOnInit" value="true" />

    <!-- Hibernate when laptop lid is closed.  This and the rest of the ACPI
         stuff needs HAL 0.5 or better to work. -->
    <!--
    <ivm:Match name="hal.info.udi" value="/org/freedesktop/Hal/devices/acpi_LID">
        <ivm:Property name="hal.button.state.value">
            <ivm:Action value="true" exec="/usr/bin/sudo /usr/sbin/hibernate" />
        </ivm:Property>
    </ivm:Match>
    -->

    <!-- Turn 'laptop mode' on if battery is being used, and off if battery gets too low. -->
    <ivm:Match name="hal.info.udi" value="/org/freedesktop/Hal/devices/acpi_BAT0">
        <ivm:Property name="hal.battery.rechargeable.is_discharging">
            <ivm:Action value="true" exec="sudo /usr/sbin/laptop_mode auto &amp;&amp; echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor" />
            <ivm:Action value="false" exec="sudo /usr/sbin/laptop_mode auto &amp;&amp; echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor" />
        </ivm:Property>

        <ivm:Property name="hal.battery.charge_level.current">
            <ivm:Action value="*" exec="$hal.battery.rechargeable.is_discharging$ &amp;&amp; [ $( expr $( expr $hal.battery.charge_level.current$ \* 100 )  / $hal.battery.charge_level.last_full$ ) -lt 5 ] &amp;&amp; /usr/sbin/laptop_mode auto" />
        </ivm:Property>
    </ivm:Match>

</ivm:PropertiesConfig>
Top
Post Reply

3 posts • Page 1 of 1

Return to “Other Things Gentoo”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic