[opensuse] command at end of bootproces
Using: Leap 42.1 At the end or somewhere else in the bootproces I want to run the command " cpupower frequency-set -g performance". What is the right method and place to do this ? Thanks, Hans -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Hans de Faber wrote:
Using: Leap 42.1
At the end or somewhere else in the bootproces I want to run the command " cpupower frequency-set -g performance".
What is the right method and place to do this ?
To my knowledge, systemd does not have a concept such as "At the end of the bootprocess", but as your command does not seem dependent on anything, I guess you can put it anywhere after whatever usually is started last. I don't know if there is a sort of "after-boot.local", but adding a local systemd unit is no big deal. -- Per Jessen, Zürich (16.7°C) http://www.dns24.ch/ - your free DNS host, made in Switzerland. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Op vrijdag 30 september 2016 09:50:43 schreef Per Jessen:
Hans de Faber wrote:
Using: Leap 42.1
At the end or somewhere else in the bootproces I want to run the command " cpupower frequency-set -g performance".
What is the right method and place to do this ?
To my knowledge, systemd does not have a concept such as "At the end of the bootprocess", but as your command does not seem dependent on anything, I guess you can put it anywhere after whatever usually is started last. I don't know if there is a sort of "after-boot.local", but adding a local systemd unit is no big deal.
Another option is to have a cronjob entry for root with the line:
@reboot
Op 30-09-16 10:03, Freek de Kruijf schreef:
Op vrijdag 30 september 2016 09:50:43 schreef Per Jessen:
Using: Leap 42.1
At the end or somewhere else in the bootproces I want to run the command " cpupower frequency-set -g performance".
What is the right method and place to do this ? To my knowledge, systemd does not have a concept such as "At the end of
Hans de Faber wrote: the bootprocess", but as your command does not seem dependent on anything, I guess you can put it anywhere after whatever usually is started last. I don't know if there is a sort of "after-boot.local", but adding a local systemd unit is no big deal. Another option is to have a cronjob entry for root with the line:
@reboot root
The command can also be a shell script.
@reboot is new for me, and it does the job Thanks -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 2016-09-30 09:50, Per Jessen wrote:
Hans de Faber wrote:
Using: Leap 42.1
At the end or somewhere else in the bootproces I want to run the command " cpupower frequency-set -g performance".
What is the right method and place to do this ?
To my knowledge, systemd does not have a concept such as "At the end of the bootprocess", but as your command does not seem dependent on anything, I guess you can put it anywhere after whatever usually is started last. I don't know if there is a sort of "after-boot.local", but adding a local systemd unit is no big deal.
Yes, there is an "/etc/init.d/after.local" file. Just create it if it does not exist. There are more local script supported: /etc/init.d/after.local /etc/init.d/before.local /etc/init.d/boot.local /etc/init.d/halt.local They run at different points in the sequence. But for the purpose of changing the governor, there might be another place. -- Cheers / Saludos, Carlos E. R. (from 13.1 x86_64 "Bottle" at Telcontar)
On 09/30/2016 03:50 AM, Per Jessen wrote:
Hans de Faber wrote:
Using: Leap 42.1
At the end or somewhere else in the bootproces I want to run the command " cpupower frequency-set -g performance".
What is the right method and place to do this ?
To my knowledge, systemd does not have a concept such as "At the end of the bootprocess", but as your command does not seem dependent on anything, I guess you can put it anywhere after whatever usually is started last. I don't know if there is a sort of "after-boot.local", but adding a local systemd unit is no big deal.
It depends on what you mean by "end or somewhere else in the boot process". With that relaxed a definition, then systemd is what you should be using. Creata unit with that command. it's a system one so it goes under /etc/systemd I would think. I'd put it under /etc/systemd/user sicne I take that to mean 'user defined' rather than 'end user. Well, OK systemd.unit(5( makes me wonder. it does say in Table 1 that Load path when running in system mode (--system). ┌────────────────────────┬─────────────────────────────┐ │Path │ Description │ ├────────────────────────┼─────────────────────────────┤ │/etc/systemd/system │ Local configuration │ ├────────────────────────┼─────────────────────────────┤ but it seems to group /etc/systemd/user with the end user in $HOME/.config I see it as an issue of maintainability under later revisions. Perhaps the important thing is to document it. However you can use the before and after sections of a unit, one of the other, to specify that 'somewhere' in the boot process. You may want to decide if you want it to occur only in multi-user mode or both single and multi user mode. That's where the 'after' and 'before comes in. Run the command systemctl list-units -t target to see some of the milestone units you can use for the before/after HOWEVER ... If you run systemctl list-units -t service you will see an entry for upower.service which is the daemon for power management. perhaps you need to communicate with that. I'd certainly make your custom unit dependent on that! Systemd and the unit model offer a great deal of flexibility about all this. it just requires more forethought, consideration of actions and consequences and planning than the old script based approach. That's often the price you pay for more power. -- A: Yes. > Q: Are you sure? >> A: Because it reverses the logical flow of conversation. >>> Q: Why is top posting frowned upon? -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On Fri, 30 Sep 2016 15:04, Anton Aylward wrote:
On 09/30/2016 03:50 AM, Per Jessen wrote:
Hans de Faber wrote:
Using: Leap 42.1
At the end or somewhere else in the bootproces I want to run the command " cpupower frequency-set -g performance".
What is the right method and place to do this ? [snip] HOWEVER ...
If you run systemctl list-units -t service you will see an entry for upower.service which is the daemon for power management. perhaps you need to communicate with that.
I'd certainly make your custom unit dependent on that!
Systemd and the unit model offer a great deal of flexibility about all this. it just requires more forethought, consideration of actions and consequences and planning than the old script based approach. That's often the price you pay for more power.
TBH, "upower" is only usefull with a desktop session. Trying to use it within a "server" envionment leads to frustration. If you try to get a working environment for a specific service / deamon, do a two step: 1. create a custom .service file in /etc/systemd/ with the wanted power cmd. 2. create and a snippet-file in /etc/systemd/<your-deamon>.service.d/[snippet-name].conf to include a added Wants=[your-custom-power-mod].service into the .service of your deamon [newer systemctl versions support the "edit" command, native Leap 42.1 does not] Infos: man systemd.unit man systemd.service https://www.suse.com/documentation/sled-12/book_sle_admin/data/sec_boot_syst... Examples: http://www.wilderssecurity.com/threads/modifying-systemd-unit-files.377427/ Uncle Google Search: systemd edit service.d drop-in YMMV. - Yamaban -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 09/30/2016 03:39 AM, Hans de Faber wrote:
Using: Leap 42.1
At the end or somewhere else in the bootproces I want to run the command " cpupower frequency-set -g performance".
What is the right method and place to do this ?
You might try the script /etc/init.d/after.local. #! /bin/sh # # Copyright (c) 2010 SuSE LINUX Products GmbH, Germany. All rights reserved. # # Author: Werner Fink, 2010 # # /etc/init.d/after.local # # script with local commands to be executed from init after all scripts # of a runlevel have been executed. # # Here you should add things, that should happen directly after # runlevel has been reached. Common environment # variables for this are: # RUNLEVEL -- The current system runlevel. # PREVLEVEL -- The previous runlevel (useful after a runlevel switch). # -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
participants (7)
-
Anton Aylward
-
Carlos E. R.
-
Freek de Kruijf
-
Hans de Faber
-
James Knott
-
Per Jessen
-
Yamaban