FedoraForum.org - Fedora Support Forums and Community
Results 1 to 12 of 12
  1. #1
    Join Date
    Feb 2014
    Location
    St. Louis
    Posts
    7

    Where to put boot time commands now?

    Used to be rc.local. I tried several tips online for modern Fedora versions to enable rc.local again, but none of them worked. Fedora changed all around and now I don't know where to put things that I want to happen on boot.

    Specifically, I want to do this: cpupower frequency-set --max 3600000

    The guide on cpupower didn't say how we could make the command persistant across boots. No mention of a configuration file for it.

    Thanks

  2. #2
    PabloTwo's Avatar
    PabloTwo is offline "Registered User" T-Shirt Winner
    Join Date
    Mar 2007
    Location
    Seville, FL
    Posts
    7,568

    Re: Where to put boot time commands now?

    You can still use the rc.local file method, it's just that the rc.local file is no longer automatically created.
    Create it in /etc/rc.d/
    As always, it's a bash format file, so first line in the file must be: #!/bin/bash
    And as always, it must be executable: # chmod +x /etc/rc.d/rc.local

    The rc-local.service will handle it.
    Code:
    $ sudo systemctl status rc-local.service
    rc-local.service - /etc/rc.d/rc.local Compatibility
       Loaded: loaded (/usr/lib/systemd/system/rc-local.service; static)
       Active: active (exited) since Wed 2014-02-05 08:13:36 EST; 4h 46min ago
      Process: 823 ExecStart=/etc/rc.d/rc.local start (code=exited, status=0/SUCCESS)
    
    Feb 05 08:13:36 Brody systemd[1]: Started /etc/rc.d/rc.local Compatibility
    What cpu are you running? If it's a newer Intel, the governor driver for it has changed (beginning in F19) to intel_pstate, which is far superior to the previous acpi-cpufreq driver.

  3. #3
    Join Date
    Feb 2014
    Location
    St. Louis
    Posts
    7

    Re: Where to put boot time commands now?

    Hello, thank you for the reply. I did try several things to get rc.local to run at boot again. Including putting the file in /etc/ and also /etc/rc.d/, starting the service with systemctl, and ensuring that texecutable bits were set. I will try it again though and see what happens.

    I am running on an i7-4960x. So, according to your guidance, I should look into intel_pstate instead, and uninstall packages relating to acpi-cpufreq?

    Thanks again

  4. #4
    PabloTwo's Avatar
    PabloTwo is offline "Registered User" T-Shirt Winner
    Join Date
    Mar 2007
    Location
    Seville, FL
    Posts
    7,568

    Re: Where to put boot time commands now?

    No, no need to uninstall anything acpi-cpufreq. The kernel will automatically choose which governor to use depending on which cpu it finds.
    Code:
    $ sudo cpupower -c 0 frequency-info
    analyzing CPU 0:
      driver: intel_pstate
      CPUs which run at the same hardware frequency: 0
      CPUs which need to have their frequency coordinated by software: 0
      maximum transition latency: 0.97 ms.
      hardware limits: 1.20 GHz - 3.10 GHz
      available cpufreq governors: performance, powersave
      current policy: frequency should be within 1.20 GHz and 3.10 GHz.
                      The governor "powersave" may decide which speed to use
                      within this range.
      current CPU frequency is 1.97 GHz (asserted by call to hardware).
      boost state support:
        Supported: yes
        Active: yes
        2900 MHz max turbo 4 active cores
        2900 MHz max turbo 3 active cores
        2900 MHz max turbo 2 active cores
        3100 MHz max turbo 1 active cores
    The intel_pstate driver handles turbo-boost very well. The above is on my:
    Code:
    Intel(R) Core(TM) i5-3210M CPU @ 2.50GHz
    cpu.

  5. #5
    Join Date
    Feb 2014
    Location
    St. Louis
    Posts
    7

    Re: Where to put boot time commands now?

    I just tried to do rc.local on this computer and got this:

    # systemctl enable rc-local.service
    The unit files have no [Install] section. They are not meant to be enabled
    using systemctl.

    If it's not meant to be enabled with systemctl, how might I enable it?


    # systemctl status rc-local.service
    rc-local.service - /etc/rc.d/rc.local Compatibility
    Loaded: loaded (/usr/lib/systemd/system/rc-local.service; enabled)
    Active: inactive (dead)

    Thanks

    ---------- Post added at 06:19 PM ---------- Previous post was at 06:16 PM ----------

    Ok -- I was changing it to sort of disable Turbo Boost. Will I still use the same command (cpupower) to do this, in rc.local, even though my processor uses intel_pstate?

    Here's the thing that prompted all of this. My other computer has an intel i7-980x. The processors there go up to, I believe, 3.3 GHz. But they are always idling at around 1.7 GHz unless a lot of work is going on. On this new computer, the processors spend a whole lot of time up in the 3+ GHz range. I want them to idle down when they're not busy, just like the other computer.

  6. #6
    PabloTwo's Avatar
    PabloTwo is offline "Registered User" T-Shirt Winner
    Join Date
    Mar 2007
    Location
    Seville, FL
    Posts
    7,568

    Re: Where to put boot time commands now?

    It's a "static" service, which means you neither enable or disable it. It just works on its own when it finds a valid rc.local file in the /etc/rc.d/ directory.
    Loaded: loaded (/usr/lib/systemd/system/rc-local.service; static)

  7. #7
    Join Date
    Feb 2014
    Location
    St. Louis
    Posts
    7

    Re: Where to put boot time commands now?

    That helps, thanks. Should I not use the cpupower command with my processor then? You mentioned there were some differences for intel_pstate? I want my processor to idle at around 1600 kHz when it's not busy, just like my other computer does.

  8. #8
    PabloTwo's Avatar
    PabloTwo is offline "Registered User" T-Shirt Winner
    Join Date
    Mar 2007
    Location
    Seville, FL
    Posts
    7,568

    Re: Where to put boot time commands now?

    On this new computer, the processors spend a whole lot of time up in the 3+ GHz range. I want them to idle down when they're not busy, just like the other computer.
    Yeah, a lot of folks used to seeing their Intel cpu's sitting at it's lowest idle speed with the acpi-cpufreq "ondeamand" governor in charge were disconcerted when they upgraded to a newer version of Fedora and then saw their cpu jumping all over the place, including over the base max frequency. Relax.

    With the intel_pstate "powersave" driver in charge, your cpu speed is overall greater, but it also lowers the actual voltage to the cpu under less stressful load. In fact, the actual cpu speed switching happens so fast with intel_pstate, your monitoring software can't even begin to follow it, it's changing in milli-second intervals. So you get crispier performance with no penalty in actual power usage. In fact, it might even be using less power.

    But, if you really want the comfort of your old and familiar acpi-cpufreq driver, all you have to do to get it back is add this to your kernel boot line:

    PHP Code:
    intel_pstat=disable 
    By doing that, the kernel will fall back to using the acpi-cpufreq driver.

    There are things you can do to manage the intel_pstate driver itself though, such as disable turbo-boost (but why would you want to?):
    Code:
    echo -n 1 > /sys/devices/system/cpu/intel_pstate/no_turbo
    My personal choice was to embrace the intel_pstate driver as a huge advance over the old acpi-cpufreq driver.
    Last edited by PabloTwo; 5th February 2014 at 07:39 PM.

  9. #9
    Join Date
    Feb 2014
    Location
    St. Louis
    Posts
    7

    Re: Where to put boot time commands now?

    My concern is not with power savings -- it's with the life time of the processor. I've assumed that with the cores all running faster, and seemingly all of the time, that the processor life will be shortened. Is this assumption false given the new information you've shown me?

    Also, do you recommend the power save governor over an alternative, with ptat?

    Thanks -- I can't believe there's not a 'thanks' function on this board. You've helped me a lot

  10. #10
    PabloTwo's Avatar
    PabloTwo is offline "Registered User" T-Shirt Winner
    Join Date
    Mar 2007
    Location
    Seville, FL
    Posts
    7,568

    Re: Where to put boot time commands now?

    I'm no real expert on cpu longevity, but from everything I do know, the one real threat to cpu life is heat. I don't think anything else has very much influence compared to heat (insufficient cooling, overclocking, overvolting, etc.). On both my desktop and laptop, which both use fairly modern Intel cpu's with turbo-boost, switching to the intel_pstate driver with the default "powersave" mode enabled did absolutely nothing to increase the cpu temps over the old acpi-cpufreq "ondemand" settings. In fact, if anything, the temps dropped by a degree or two, and the performance increased.

    The intel_pstate driver offers only two governors, performance and powersave. I've not tried using the performance governor, nor have I read up on it to find out what it's advantages/disadvantages might be.

  11. #11
    Join Date
    Feb 2014
    Location
    St. Louis
    Posts
    7

    Re: Where to put boot time commands now?

    Sounds good, thank you again. Huge help.

  12. #12
    Join Date
    Jan 2011
    Posts
    1,116

    Re: Where to put boot time commands now?

    UDEV rules seems to be another path to do that.

    * Listing devices names:
    udevadm info --export-db | grep -i devname

    * Listing attributes for devices:
    udevadm info -q all --attribute-walk /dev/cpu/microcode
    udevadm info -a -n /dev/cpu/microcode

    e.g.:
    Code:
    /etc/udev/rules.d/75-hdparm.rules
    
    ACTION=="add", KERNEL=="sd[a-z]", ATTR{queue/rotational}=="1", RUN+="/usr/bin/hdparm -B 254 /dev/$kernel"
    Source: https://wiki.archlinux.org/index.php/laptop#Udev_events

    Resources:
    http://www.reactivated.net/writing_u...es.html#syntax (old need updating but still usefull)
    http://www.monperrus.net/martin/ligh...nd+cpufreq-set (udev rule written to change cpu frequency to be taken as a sample do not implement that rule if you didn't do the match of proper devices and atttributes that you wanna target)
    https://wiki.archlinux.org/index.php...gain_on_resume (This too looks promising)

    Note:

    There are two utilities to look at.
    bootctl
    sysctl
    Last edited by dobbi; 6th February 2014 at 08:41 AM.

Similar Threads

  1. changing System time, and running commands through root
    By tim.pirate in forum Using Fedora
    Replies: 3
    Last Post: 19th March 2008, 05:59 AM
  2. Can i delete GRUB and put the XP boot without cd???
    By Dograzor in forum Using Fedora
    Replies: 5
    Last Post: 15th July 2007, 10:51 PM
  3. where to put scripts to run at boot
    By golpemortal in forum Using Fedora
    Replies: 6
    Last Post: 25th February 2007, 07:03 PM
  4. where to put boot record on FC5/XP dual boot system?
    By hm4288 in forum Installation, Upgrades and Live Media
    Replies: 6
    Last Post: 26th March 2006, 06:48 PM
  5. where do I put scripts to run only during a boot?
    By linuxted in forum Using Fedora
    Replies: 1
    Last Post: 10th August 2005, 04:35 AM

Tags for this Thread

Posting Permissions

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