1
0
Fork 0
Commit graph

31 commits

Author SHA1 Message Date
Ondřej Lysoněk
bc8ffcfb23 Introduce the concept of manually vs automatically set profile
A profile can now be set in two modes: automatic and manual.

When the automatic mode is active, Tuned always activates the
recommended profile upon startup. This mode can be set using
the following command:
tuned-adm auto_profile

When the manual mode is active, the previously applied profile
is activated upon startup. This mode can be set by switching
to the desired profile, e.g.
tuned-adm profile throughput-performance

The mode is saved on the second line of /etc/tuned/active_profile.

When the file /etc/tuned/active_profile does not exist, or is
empty, automatic mode is enabled. When the file has only one line,
i.e. it was generated by a previous Tuned version, manual mode
is enabled so that the upgrade doesn't cause unexpected active profile
changes.

Related: rhbz#1459146

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2017-08-03 15:23:54 +02:00
Ondřej Lysoněk
82997069b4 List available profiles on 'tuned-adm profile'
List available profiles when 'tuned-adm profile' is run
without a profile name.

Resolves: rhbz#988433

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2017-04-21 16:43:55 +02:00
Jaroslav Škarvada
e9c8815c0e tuned-adm: simplified no_deamon check regarding DBus
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2016-07-14 18:09:46 +02:00
Jaroslav Škarvada
b70a93dd8a tuned-adm: fixed detection of no_daemon mode
In no_daemon mode it doesn't try to query DBus, so it doesn't
output DBus error.

Resolves: rhbz#1351536

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2016-07-14 17:39:29 +02:00
Jaroslav Škarvada
b117e9204b tuned-adm: rewrote multithreading code to glib
The glib/dbus doesn't like multithreading which is not handled
by them, thus the code may segfault. According to
https://bugzilla.redhat.com/show_bug.cgi?id=1330127#c2
it is not supportd and dbus-glib/dbus-python are not thread safe.
This commit moves multithreading under glib and handles all
in the glib mainloop, thus it may no longer segfaults.

It also adds --timeout, -t command line parameter which may
specify timeout for the sync operations, e.g.:
 # tuned-adm --timeout 200 profile balanced
wil use 200 seconds timeout when waiting for the profile to
load.

The default timeout was increased to 90 seconds to match
systemd default timeouts.

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2016-06-07 17:58:45 +02:00
Jaroslav Škarvada
a174592cfd verify: added ignore-missing mode
The verify command can now be run in ignore-missing mode. In this mode
missing/non-supported settings (i.e. those which current value is None)
are ignored and not treated as errors.

The tuned-adm got new verify options -i and --ignore-missing which
enables the ignore-missing mode, usage:
  tuned-adm verify -i
or:
  tuned-adm verify --ignore-missing

The DBus interface got new method 'verify_profile_ignore_missing' which
does the verification in ignore-missing mode.

Resolves: rhbz#1243807

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2016-04-22 18:05:16 +02:00
Jaroslav Škarvada
67f78d632e tuned-adm: synchronous profile switching
By default tuned-adm now synchronously switch profiles, i.e it waits untill
the profile is applied and then returns to the shell. It returns with
exitcode 0 if profile is correctly applied. If there is an error it uses
exitcode > 0 (currently only 1 is used) and displays error. For reverting
to old behaviour (i.e. asynchronous profile switching) when the tuned-adm
returns immediately there is an tuned-adm command line option -a (or --async).

D-Bus API was extended to allow synchronous profile switching. Now the
"profile_changed" D-Bus signal is sent when the profile is applied. The
signal contains the following data:

profile_name:string - the name of the profile which was applied
result:boolean      - status of the operation, true if OK, false on error
errstr:string       - string containing description of the error (if result is
                      false)

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2016-04-21 14:55:19 +02:00
Jaroslav Škarvada
c24e2ea0ca Added support for 'summary' and 'description' of profiles
Added new tuned-adm functionality 'profile_info'. It has optional parameter
'profile_name'. If called without parameter, active profile is used.
It outputs name of the profile it is querying, profile summary, and profile
description. If there is no profile summary or description available it
outputs empty string(s).

Extended tuned-adm 'list' functionality. It now displays profile summary
in the list (if available).

Added summary to profiles.

Extended D-Bus API to support the new feature and for better Cockpit support:
 - Added 'profile_info' method. It gets profile_name argument and it queries
   the requested profile for information. If profile_name is empty string it
   queries the active/selected profile. It returns tuple of the following
   format (status, profile_name, summary, description), where status is
   boolean. If it is False, the query mechanism failed and the other fields
   don't contain valid data
 - Added 'profiles2' method. It's extension of 'profiles' method. It returns
   list of tuples. Tuples have following format:
   (profile_name, profile_summary)

Related: rhbz#1228356
Fixes: #46

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2016-01-05 11:28:25 +01:00
Jaroslav Škarvada
4cefd36c87 tuned: added one-shot no daemon mode
Most of the functionality don' work in this mode, it just
applies the settings, no rollback possible.

Disable daemon by setting 'daemon = 0' in /etc/tuned/tuned-main.conf

This settings can be overridden if running tuned with '-d' command line
option. In such case daemon mode will be used.

Resolves: rhbz#1068663

Also fixed interpretation of booleans in main config.

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2015-07-02 17:17:31 +02:00
Jaroslav Škarvada
c73bc90ae8 recommend: add global config option to disable 'recommend' functionality
On some platforms the 'recommend' functionality doens't make sense
as there is only one product variant. On such platforms the recommend
functionality can be disabled by adding/changing the following in
the global config (/etc/tuned/tuned-main.conf):

recommend_command = 0

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2015-06-10 16:26:36 +02:00
Jaroslav Škarvada
6940d280b6 tuned: added verify command
The verify command verifies whether the current system settings matches
activated profile. It also writes all settings from the active profile
with the current / expected values to the log. It is good for checking
what is exactly set and what changed during the run.

Currently custom commands and plugin_scheduler are not supported.

Resolves: rhbz#1150047
Fixes: #34

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2015-05-18 18:55:01 +02:00
Jaroslav Škarvada
56ecbd362e tuned: Improved error messages
Made tuned error messages less verbose, but more descriptive if running without
debug option. Also made class from the tuned.utils.commands helper functions.
Its logging can be enabled / disabled.

Resolves: rhbz#1068699

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2014-09-24 16:15:06 +02:00
Jaroslav Škarvada
d233fd7c31 misc: bumped year in copyright to 2013
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2013-11-27 09:30:07 +01:00
Jaroslav Škarvada
f560833d7a tuned, tuned-adm: moved dbus consts to consts file
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2013-02-18 12:18:18 +01:00
Jaroslav Škarvada
b68fea0ca9 tuned, tuned-adm: added new option --version, -v to show version
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2013-02-18 12:15:25 +01:00
Jaroslav Škarvada
3d95e77f78 implemented recommend profile functionality
resolves: rhbz#848935
2012-11-29 10:25:05 +01:00
Jan Vcelak
a49f53e60f GPL headers only into executables and main module
GPL license does not require all files to have the copyright notice
and header. To save some space, I removed the headers from all files
except the executables and the main Python module.
2012-11-09 12:27:20 +01:00
Jan Vcelak
718a611a7f tuned-adm: switch completely to DBus 2012-11-05 17:02:52 +01:00
Jan Vcelak
09d20c648a run python interpret with '-Es' options 2012-10-30 11:40:29 +01:00
Jaroslav Škarvada
135e19f654 Use /run instead of /var/run 2012-10-25 12:05:16 +02:00
Jaroslav Škarvada
2edd5852cb tuned-adm: check EUID instead of UID 2012-10-19 17:07:25 +02:00
Jaroslav Škarvada
6f6e366488 Fixed 'null' profile selection 2012-10-10 22:55:52 +02:00
Chris Lockfort
bf0a1f3a68 tuned-adm: sort available profiles 2012-06-08 10:46:20 +02:00
HanzZ
d0028379f4 Load/store more profiles in active_profile file 2012-05-07 09:33:23 +02:00
HanzZ
99a863f517 Fix tuned-adm typo 2012-04-06 09:53:58 +02:00
Jaroslav Škarvada
ea412c9064 tuned-adm: added check if requested profile exists 2012-03-30 19:05:40 +02:00
Jaroslav Škarvada
ae3f629827 tuned: config file suffix changed to .conf
profiles: config files renamed to end with .conf
man: minor update of tuned.conf.5
Makefile: install tuned_powertop_profile.py script
2012-03-28 16:26:18 +02:00
Jan Kaluza
0541ad4081 Implement tuned-adm off 2012-03-14 09:52:27 +01:00
Jan Kaluza
3a5db1257a first try of tuned-adm active command 2012-03-13 14:02:52 +01:00
Jan Kaluza
83a7845f93 tuned-adm list 2012-03-13 13:58:45 +01:00
Jan Kaluza
0faaa74df3 tuned.cfg man page + initial tuned-adm 2012-03-13 13:20:52 +01:00