Results 1 to 9 of 9

Thread: commands in scripts are not working

  1. #1
    Join Date
    Oct 2008
    Beans
    37

    [solved]commands in scripts are not working

    I want to save some watts during usage of my laptop so i read that i must use these commands:
    Code:
    echo 5 > /proc/sys/vm/laptop_mode
    echo 1 > /sys/module/snd_hda_intel/parameters/power_save
    echo 3000 > /proc/sys/vm/dirty_writeback_centisecs
    cpufreq-set -c 0 -g powersave
    cpufreq-set -c 1 -g powersave
    ethtool -s eth0 wol d
    I had put these commands in to /etc/rc.local (no effect), /etc/sysctl.conf (no effect)

    every time I log in I have to "sudo su" in terminal and insert upper commands

    btw I have compilled newest stable kernerl with CONFIG_SND_HDA_POWER_SAVE_DEFAULT set to 1 but that desn't help too
    Last edited by pacman401; February 27th, 2013 at 09:50 AM.

  2. #2
    Join Date
    Feb 2011
    Location
    Coquitlam, B.C. Canada
    Beans
    1,465
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: commands in scripts are not working

    During power up or re-boot there is a 1 minute delay before the CPUs are set to ondemand mode. I suspect your script runs before this time delay, and so your powersave settings get overwritten. see: /etc/init.d/ondemand
    Perhaps you could delay your script longer with a sleep.
    I don't know about your other commands.
    Any follow-up information on your issue would be appreciated. Please have the courtesy to report back.

  3. #3
    Join Date
    May 2010
    Location
    Tewkesbury uk
    Beans
    7,680
    Distro
    Ubuntu Development Release

    Re: commands in scripts are not working

    Hi

    Quote Originally Posted by Doug S View Post
    During power up or re-boot there is a 1 minute delay before the CPUs are set to ondemand mode. I suspect your script runs before this time delay, and so your powersave settings get overwritten. see: /etc/init.d/ondemand
    Perhaps you could delay your script longer with a sleep.
    I don't know about your other commands.
    Yep. Bang on the money.

    Maybe use a cron job @reboot with a sleep statement for 2 mins. Let the system settle down.

    Thats the way i would do it.

    Kind regards
    Join us on irc at #ubuntuforums. For web chat see here

    If you believe everything you read, you better not read. ~ Japanese Proverb

    Do not read newspapers on an empty stomach ~ Russian Proverb ~ BrunoLotse

  4. #4
    Join Date
    Oct 2008
    Beans
    37

    Re: commands in scripts are not working

    let's forget on setting cpu to powersave mode (i recompiled kernel with powersave governor option and it is working ...for now)
    #########################update
    f***** was working , after rebot i have mode ondemand :/


    what about rest commands

    btw delaying script start don't delay also reboot by that time ?
    Last edited by pacman401; February 25th, 2013 at 10:11 PM.

  5. #5
    Join Date
    Feb 2013
    Beans
    Hidden!

    Re: commands in scripts are not working

    Quote Originally Posted by pacman401 View Post
    btw delaying script start don't delay also reboot by that time ?
    Well, if you specify it as @reboot in a crontab then it means at the time the cron daemon starts. You can put something like
    Code:
    COMMAND | at now + 5 minutes
    to make COMMAND be executed 5 minutes after that. See at(1)
    Last edited by schragge; February 28th, 2013 at 03:12 AM.

  6. #6
    Join Date
    May 2010
    Location
    Tewkesbury uk
    Beans
    7,680
    Distro
    Ubuntu Development Release

    Re: commands in scripts are not working

    Hi

    btw delaying script start don't delay also reboot by that time ?
    Just to clarify i would have the sleep statement the script i would call from cron at reboot.

    Kind regards
    Join us on irc at #ubuntuforums. For web chat see here

    If you believe everything you read, you better not read. ~ Japanese Proverb

    Do not read newspapers on an empty stomach ~ Russian Proverb ~ BrunoLotse

  7. #7
    Join Date
    Oct 2008
    Beans
    37

    Re: commands in scripts are not working

    Quote Originally Posted by Doug S View Post
    During power up or re-boot there is a 1 minute delay before the CPUs are set to ondemand mode.
    how to disable it / where is config to change that ondemand mode ?

  8. #8
    Join Date
    Feb 2011
    Location
    Coquitlam, B.C. Canada
    Beans
    1,465
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: commands in scripts are not working

    see this.
    Any follow-up information on your issue would be appreciated. Please have the courtesy to report back.

  9. #9
    Join Date
    Oct 2008
    Beans
    37

    Re: commands in scripts are not working

    solved by
    sudo sh -c 'echo <num> > <cmd>'
    http://askubuntu.com/questions/50242...-sudo-not-work
    thx every one for trying help

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •