LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-10-2019, 01:17 PM   #1
sox
LQ Newbie
 
Registered: Jan 2019
Posts: 6

Rep: Reputation: Disabled
Powertop script autorun


Hello,
How to make powertop script working? I made executable powertop.sh with first line #!/bin/bash and added to kde autorun, but there are no changes. Previously i had it in rclocal, but its not in debian anymore. I know I can create it but I want to do it by script. I also dont want to create deamon, because autotune turning off too much, for example mouse. Is any simple way to do it?
 
Old 02-10-2019, 01:19 PM   #2
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 12,025

Rep: Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693
I do not know what is this powertop script, but you cannot make any script executable by inserting #!/bin/bash. you need to chmod +x.
 
Old 02-11-2019, 02:05 PM   #3
sox
LQ Newbie
 
Registered: Jan 2019
Posts: 6

Original Poster
Rep: Reputation: Disabled
Little misunderstanding. Below is that what I have.

Code:
copr@home:~$ ls -la Desktop/powertop.sh 
-rwxr-xr-x 1 copr copr 1685 lut 10 18:54 Desktop/powertop.sh
copr@home:~$ cat Desktop/powertop.sh 
#!/bin/bash
echo '1500' > '/proc/sys/vm/dirty_writeback_centisecs';
echo '0' > '/proc/sys/kernel/nmi_watchdog';
echo '1' > '/sys/module/snd_hda_intel/parameters/power_save';
echo 'min_power' > '/sys/class/scsi_host/host0/link_power_management_policy';
echo 'min_power' > '/sys/class/scsi_host/host1/link_power_management_policy';
echo 'auto' > '/sys/bus/usb/devices/1-7/power/control';
 
Old 02-11-2019, 02:23 PM   #4
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: MID-SOUTH USA
Distribution: Slackware 14.2 current / Linux Mint / Debian / Void Linux
Posts: 7,910

Rep: Reputation: 1606Reputation: 1606Reputation: 1606Reputation: 1606Reputation: 1606Reputation: 1606Reputation: 1606Reputation: 1606Reputation: 1606Reputation: 1606Reputation: 1606
if it is on the system side, did you run it as root?
did you insure that they are in fact real directories and file names?

put sudo in front of every command within your script.
 
Old 02-12-2019, 03:40 AM   #5
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 10,725
Blog Entries: 7

Rep: Reputation: 2680Reputation: 2680Reputation: 2680Reputation: 2680Reputation: 2680Reputation: 2680Reputation: 2680Reputation: 2680Reputation: 2680Reputation: 2680Reputation: 2680
Quote:
Originally Posted by sox View Post
I made executable powertop.sh with first line #!/bin/bash and added to kde autorun, but there are no changes. Previously i had it in rclocal, but its not in debian anymore. I know I can create it but I want to do it by script. I also dont want to create deamon, because autotune turning off too much, for example mouse. Is any simple way to do it?
Quote:
Originally Posted by sox View Post
Code:
copr@home:~$ ls -la Desktop/powertop.sh 
-rwxr-xr-x 1 copr copr 1685 lut 10 18:54 Desktop/powertop.sh
copr@home:~$ cat Desktop/powertop.sh 
#!/bin/bash
echo '1500' > '/proc/sys/vm/dirty_writeback_centisecs';
echo '0' > '/proc/sys/kernel/nmi_watchdog';
echo '1' > '/sys/module/snd_hda_intel/parameters/power_save';
echo 'min_power' > '/sys/class/scsi_host/host0/link_power_management_policy';
echo 'min_power' > '/sys/class/scsi_host/host1/link_power_management_policy';
echo 'auto' > '/sys/bus/usb/devices/1-7/power/control';
this won't work with KDE autorun because it requires superuser privileges.
if it worked from rc.local - what distro are you using now? does it use systemd? creating a systemd service would probably be the correct way to go about it.

although i'm pretty sure that most of these options can be achieved by editing some files, e.g.:
create a file in /etc/sysctl.d. but you can't just copy the script there, you need to read 'man sysctl.d'
module options: 'man modprobe.d'
etc.
 
Old 02-17-2019, 09:31 AM   #6
sox
LQ Newbie
 
Registered: Jan 2019
Posts: 6

Original Poster
Rep: Reputation: Disabled
Guys thakns for help, i made rc.local and works fine.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
powertop reporting a huge number of acpi interrupts gawhelan Linux - Laptop and Netbook 5 01-15-2009 03:12 AM
LXer: Watching Your Power Consumption With Powertop On Fedora 7 LXer Syndicated Linux News 0 10-01-2007 04:30 PM
C-state not showing in powertop rengo.Java Linux - Laptop and Netbook 6 09-26-2007 07:44 AM
LXer: Saving Power on Intel Hardware Using Powertop LXer Syndicated Linux News 0 09-02-2007 01:50 PM
LXer: Intel and PowerTOP extend Linux laptop battery life LXer Syndicated Linux News 0 05-17-2007 12:16 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:34 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration