FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor


 
 
LinkBack Thread Tools
 
Old 09-17-2012, 03:40 PM
Martín Cigorraga
 
Default /etc/tmpfiles.d

"[...]However, tmpfiles may also be used to write values into certain files
on boot. For example, if you use /etc/rc.local to disable wakeup from USB
devices with echo USBE > /proc/acpi/wakeup, you may use the following
tmpfile instead:


/etc/tmpfiles.d/disable-usb-wake.conf


w /proc/acpi/wakeup - - - - USBE

The tmpfiles method is recommended in this case since systemd doesn't
actually support /etc/rc.local."

Does that means that I need to move all the content from /etc/rc.local to
/etc/tmpfiles.d? For example this is my actual /etc/rc.local:
~ $ cat /etc/rc.local
#!/bin/bash
#
# /etc/rc.local: Local multi-user startup script.
#

#modprobe radeon # added by hybrid-video-ati-intel install script
#echo IGD > /sys/kernel/debug/vgaswitcheroo/switch # added by
hybrid-video-ati-intel install script
echo OFF > /sys/kernel/debug/vgaswitcheroo/switch # completely deactivate
radeon

## ATi
# Source: https://wiki.archlinux.org/index.php/ATI#Performance_tuning
echo low > /sys/class/drm/card0/device/power_profile
#echo profile > /sys/class/drm/card0/device/power_method
echo dynpm > /sys/class/drm/card0/device/power_method
echo OFF > /sys/kernel/debug/vgaswitcheroo/switch

# CPUFREQ
for i in 0 1 2 3; do cpufreq-set -c $i -g powersave; done ## sets
powersave cpufreq governor for all CPU cores
#echo -n 90 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
echo -n 20 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor

# Prepare the system for Wake-on-Lan
/usr/sbin/ethtool -s eth0 wol pg

# Activate laptop_mode
echo 5 > /proc/sys/vm/laptop_mode

# Performance tweaks for USB drivers under KDE SC
echo madvise > /sys/kernel/mm/transparent_hugepage/enabled
echo madvise > /sys/kernel/mm/transparent_hugepage/defrag
echo 0 > /sys/kernel/mm/transparent_hugepage/khugepaged/defrag


If this is the case, how do you guys would convert the FOR loop!?
 
Old 09-17-2012, 04:17 PM
Chris Sakalis
 
Default /etc/tmpfiles.d

Hello.

> Does that means that I need to move all the content from /etc/rc.local to
> /etc/tmpfiles.d? For example this is my actual /etc/rc.local:

Only if you no longer boot with initscripts.

> # CPUFREQ
> for i in 0 1 2 3; do cpufreq-set -c $i -g powersave; done ## sets
> powersave cpufreq governor for all CPU cores
> #echo -n 90 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
> echo -n 20 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor
>(...)
> If this is the case, how do you guys would convert the FOR loop!?

I think that tempfiles can not execute commands, only create/write to
files. If you want to run some commands, you should probably create
some custom unit files.

Regards,
Chris Sakalis
 
Old 09-17-2012, 04:31 PM
Matthew Monaco
 
Default /etc/tmpfiles.d

On 09/17/2012 09:40 AM, Martín Cigorraga wrote:
> "[...]However, tmpfiles may also be used to write values into certain files
> on boot. For example, if you use /etc/rc.local to disable wakeup from USB
> devices with echo USBE > /proc/acpi/wakeup, you may use the following
> tmpfile instead:
>
>
> /etc/tmpfiles.d/disable-usb-wake.conf
>
>
> w /proc/acpi/wakeup - - - - USBE
>
> The tmpfiles method is recommended in this case since systemd doesn't
> actually support /etc/rc.local."
>
> Does that means that I need to move all the content from /etc/rc.local to
> /etc/tmpfiles.d? For example this is my actual /etc/rc.local:
> ~ $ cat /etc/rc.local
> #!/bin/bash
> #
> # /etc/rc.local: Local multi-user startup script.
> #
>
> #modprobe radeon # added by hybrid-video-ati-intel install script
> #echo IGD > /sys/kernel/debug/vgaswitcheroo/switch # added by
> hybrid-video-ati-intel install script
> echo OFF > /sys/kernel/debug/vgaswitcheroo/switch # completely deactivate
> radeon
>
> ## ATi
> # Source: https://wiki.archlinux.org/index.php/ATI#Performance_tuning
> echo low > /sys/class/drm/card0/device/power_profile
> #echo profile > /sys/class/drm/card0/device/power_method
> echo dynpm > /sys/class/drm/card0/device/power_method
> echo OFF > /sys/kernel/debug/vgaswitcheroo/switch
>
> # CPUFREQ
> for i in 0 1 2 3; do cpufreq-set -c $i -g powersave; done ## sets
> powersave cpufreq governor for all CPU cores
> #echo -n 90 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
> echo -n 20 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor
>
> # Prepare the system for Wake-on-Lan
> /usr/sbin/ethtool -s eth0 wol pg
>
> # Activate laptop_mode
> echo 5 > /proc/sys/vm/laptop_mode
>
> # Performance tweaks for USB drivers under KDE SC
> echo madvise > /sys/kernel/mm/transparent_hugepage/enabled
> echo madvise > /sys/kernel/mm/transparent_hugepage/defrag
> echo 0 > /sys/kernel/mm/transparent_hugepage/khugepaged/defrag
>
>
> If this is the case, how do you guys would convert the FOR loop!?
>

For ethtool, just create a separate service that executes that command.

Everything else you do is writing to /sys, so you can have one giant tmpfiles.d
file.

For the for loop:
w /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor - - - - powersave
w /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor - - - - powersave
w /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor - - - - powersave
w /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor - - - - powersave

Also, I don't think it's an error if the file doesn't exist, so you can just do
cpu0..cpu16 or whatever if you feel like.
 
Old 09-17-2012, 04:42 PM
Thomas Bächler
 
Default /etc/tmpfiles.d

Am 17.09.2012 17:40, schrieb Martín Cigorraga:
> # CPUFREQ
> for i in 0 1 2 3; do cpufreq-set -c $i -g powersave; done ## sets
> powersave cpufreq governor for all CPU cores
> #echo -n 90 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
> echo -n 20 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor

Slightly off-topic, but you should really read this:
http://mjg59.livejournal.com/88608.html
 
Old 09-18-2012, 12:44 AM
Curtis Shimamoto
 
Default /etc/tmpfiles.d

On 09/17/12 at 10:31am, Matthew Monaco wrote:
> On 09/17/2012 09:40 AM, Mart?n Cigorraga wrote:
> > "[...]However, tmpfiles may also be used to write values into certain files
> > on boot. For example, if you use /etc/rc.local to disable wakeup from USB
> > devices with echo USBE > /proc/acpi/wakeup, you may use the following
> > tmpfile instead:
> >
> >
> > /etc/tmpfiles.d/disable-usb-wake.conf
> >
> >
> > w /proc/acpi/wakeup - - - - USBE
> >
> > The tmpfiles method is recommended in this case since systemd doesn't
> > actually support /etc/rc.local."
> >
> > Does that means that I need to move all the content from /etc/rc.local to
> > /etc/tmpfiles.d? For example this is my actual /etc/rc.local:
> > ~ $ cat /etc/rc.local
> > #!/bin/bash
> > #
> > # /etc/rc.local: Local multi-user startup script.
> > #
> >
> > #modprobe radeon # added by hybrid-video-ati-intel install script
> > #echo IGD > /sys/kernel/debug/vgaswitcheroo/switch # added by
> > hybrid-video-ati-intel install script
> > echo OFF > /sys/kernel/debug/vgaswitcheroo/switch # completely deactivate
> > radeon
> >
> > ## ATi
> > # Source: https://wiki.archlinux.org/index.php/ATI#Performance_tuning
> > echo low > /sys/class/drm/card0/device/power_profile
> > #echo profile > /sys/class/drm/card0/device/power_method
> > echo dynpm > /sys/class/drm/card0/device/power_method
> > echo OFF > /sys/kernel/debug/vgaswitcheroo/switch
> >
> > # CPUFREQ
> > for i in 0 1 2 3; do cpufreq-set -c $i -g powersave; done ## sets
> > powersave cpufreq governor for all CPU cores
> > #echo -n 90 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
> > echo -n 20 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor
> >
> > # Prepare the system for Wake-on-Lan
> > /usr/sbin/ethtool -s eth0 wol pg
> >
> > # Activate laptop_mode
> > echo 5 > /proc/sys/vm/laptop_mode
> >
> > # Performance tweaks for USB drivers under KDE SC
> > echo madvise > /sys/kernel/mm/transparent_hugepage/enabled
> > echo madvise > /sys/kernel/mm/transparent_hugepage/defrag
> > echo 0 > /sys/kernel/mm/transparent_hugepage/khugepaged/defrag
> >
> >
> > If this is the case, how do you guys would convert the FOR loop!?
> >
>
> For ethtool, just create a separate service that executes that command.
>
> Everything else you do is writing to /sys, so you can have one giant tmpfiles.d
> file.
>
> For the for loop:
> w /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor - - - - powersave
> w /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor - - - - powersave
> w /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor - - - - powersave
> w /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor - - - - powersave
>
> Also, I don't think it's an error if the file doesn't exist, so you can just do
> cpu0..cpu16 or whatever if you feel like.

I am fairly certain that tmpfiles.d understands "*", so you could
probably get away with one line for something like that.
--
Curtis Shimamoto
sugar.and.scruffy@gmail.com
 
Old 09-18-2012, 01:17 AM
Matthew Monaco
 
Default /etc/tmpfiles.d

On 09/17/2012 06:44 PM, Curtis Shimamoto wrote:
> On 09/17/12 at 10:31am, Matthew Monaco wrote:
>> On 09/17/2012 09:40 AM, Mart?n Cigorraga wrote:
>>> "[...]However, tmpfiles may also be used to write values into certain files
>>> on boot. For example, if you use /etc/rc.local to disable wakeup from USB
>>> devices with echo USBE > /proc/acpi/wakeup, you may use the following
>>> tmpfile instead:
>>>
>>>
>>> /etc/tmpfiles.d/disable-usb-wake.conf
>>>
>>>
>>> w /proc/acpi/wakeup - - - - USBE
>>>
>>> The tmpfiles method is recommended in this case since systemd doesn't
>>> actually support /etc/rc.local."
>>>
>>> Does that means that I need to move all the content from /etc/rc.local to
>>> /etc/tmpfiles.d? For example this is my actual /etc/rc.local:
>>> ~ $ cat /etc/rc.local
>>> #!/bin/bash
>>> #
>>> # /etc/rc.local: Local multi-user startup script.
>>> #
>>>
>>> #modprobe radeon # added by hybrid-video-ati-intel install script
>>> #echo IGD > /sys/kernel/debug/vgaswitcheroo/switch # added by
>>> hybrid-video-ati-intel install script
>>> echo OFF > /sys/kernel/debug/vgaswitcheroo/switch # completely deactivate
>>> radeon
>>>
>>> ## ATi
>>> # Source: https://wiki.archlinux.org/index.php/ATI#Performance_tuning
>>> echo low > /sys/class/drm/card0/device/power_profile
>>> #echo profile > /sys/class/drm/card0/device/power_method
>>> echo dynpm > /sys/class/drm/card0/device/power_method
>>> echo OFF > /sys/kernel/debug/vgaswitcheroo/switch
>>>
>>> # CPUFREQ
>>> for i in 0 1 2 3; do cpufreq-set -c $i -g powersave; done ## sets
>>> powersave cpufreq governor for all CPU cores
>>> #echo -n 90 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
>>> echo -n 20 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor
>>>
>>> # Prepare the system for Wake-on-Lan
>>> /usr/sbin/ethtool -s eth0 wol pg
>>>
>>> # Activate laptop_mode
>>> echo 5 > /proc/sys/vm/laptop_mode
>>>
>>> # Performance tweaks for USB drivers under KDE SC
>>> echo madvise > /sys/kernel/mm/transparent_hugepage/enabled
>>> echo madvise > /sys/kernel/mm/transparent_hugepage/defrag
>>> echo 0 > /sys/kernel/mm/transparent_hugepage/khugepaged/defrag
>>>
>>>
>>> If this is the case, how do you guys would convert the FOR loop!?
>>>
>>
>> For ethtool, just create a separate service that executes that command.
>>
>> Everything else you do is writing to /sys, so you can have one giant tmpfiles.d
>> file.
>>
>> For the for loop:
>> w /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor - - - - powersave
>> w /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor - - - - powersave
>> w /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor - - - - powersave
>> w /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor - - - - powersave
>>
>> Also, I don't think it's an error if the file doesn't exist, so you can just do
>> cpu0..cpu16 or whatever if you feel like.
>
> I am fairly certain that tmpfiles.d understands "*", so you could
> probably get away with one line for something like that.
>

It doesn't for the 'w' type. Globbing is specified explicitly where it's
supported. I don't know if that was an explicit design decision though. You
might have yourself an easy patch if you want to contribute.
 
Old 09-18-2012, 07:33 AM
Alexander Bashmakov
 
Default /etc/tmpfiles.d

>> I am fairly certain that tmpfiles.d understands "*", so you could
>> probably get away with one line for something like that.
>>
>
> It doesn't for the 'w' type. Globbing is specified explicitly where it's
> supported. I don't know if that was an explicit design decision though. You
> might have yourself an easy patch if you want to contribute.

It will be supported in next release:
http://cgit.freedesktop.org/systemd/systemd/commit/?id=d4e9eb91ea12e11bff7d8c6265b067a20ccf37b8
 

Thread Tools




All times are GMT. The time now is 06:38 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org