Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 590914 - sys-apps/tuned - tuned.utils.commands: Executing /sbin/sysctl error: [Errno 2] No such file or directory
Summary: sys-apps/tuned - tuned.utils.commands: Executing /sbin/sysctl error: [Errno 2...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Yixun Lan
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-08-10 08:18 UTC by theShirbiny
Modified: 2016-10-11 08:31 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
tuned-2.7.1-sysctl.patch (tuned-2.7.1-sysctl.patch,338 bytes, patch)
2016-09-08 06:56 UTC, Jeroen Roovers (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description theShirbiny 2016-08-10 08:18:31 UTC
checking /var/log/tuned.log I've found the following 

2016-08-08 02:05:46,228 ERROR    tuned.utils.commands: Executing /sbin/sysctl error: [Errno 2] No such file or directory


the problem seems to be in /usr/lib64/python2.7/site-packages/tuned/plugins/plugin_sysctl.py line 70 

it should be /usr/sbin/sysctl not /sbin/sysctl

------------------------------------------------------------------------
Also we might need to add (selinux) flag cause tuned-gui doesn't work without selinux

this is what I'm getting when I try to launch tuned-gui

Traceback (most recent call last):
  File "/usr/sbin/tuned-gui", line 1026, in <module>
    base = Base()
  File "/usr/sbin/tuned-gui", line 148, in __init__
    tuned.gtk.gui_plugin_loader.GuiPluginLoader()
  File "/usr/lib64/python2.7/site-packages/tuned/gtk/gui_plugin_loader.py", line 86, in __init__
    self.create_all(self._import_plugin_names())
  File "/usr/lib64/python2.7/site-packages/tuned/gtk/gui_plugin_loader.py", line 118, in create_all
    self._plugins.add(self.repo.create(plugin_name))
  File "/usr/lib64/python2.7/site-packages/tuned/plugins/repository.py", line 35, in create
    self._plugin_instance_factory, self._global_cfg, self._variables)
  File "/usr/lib64/python2.7/site-packages/tuned/plugins/plugin_selinux.py", line 27, in __init__
    raise exceptions.NotSupportedPluginException("SELinux is not enabled on your system or incompatible version is used.")
NameError: global name 'exceptions' is not defined

disabling tuned's selinux plugin fixes this problem, let me know if you want me to split these into two reports

Thanks
Comment 1 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2016-08-10 08:53:14 UTC
commit 8f17ed27906b9cd2deda507a2a1b6ab00b75eaab
Author: Lars Wendler <polynomial-c@gentoo.org>
Date:   Wed Aug 10 10:52:30 2016

    mail-client/claws-mail: Don't run python phases unconditionally.
    
    Fixing bug #590914.
    Refactored latest ebuild a bit.
    
    Package-Manager: portage-2.3.0
    Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
Comment 2 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2016-08-10 08:53:32 UTC
Ah sorry, wrong bug :-(
Comment 3 Jeroen Roovers (RETIRED) gentoo-dev 2016-09-08 06:54:12 UTC
ping
Comment 4 Jeroen Roovers (RETIRED) gentoo-dev 2016-09-08 06:56:08 UTC
Created attachment 445194 [details, diff]
tuned-2.7.1-sysctl.patch

Obviously we can change that path, but can we be sure sysctl will always be there?
Comment 5 Yixun Lan archtester gentoo-dev 2016-09-08 08:21:16 UTC
sorry, this bug slip my list

I've reported similar bug to upstream, they probably only tested on fedora system


can we simply use "sysctl" instead of hard-coding the path?
Comment 6 theShirbiny 2016-09-08 08:49:32 UTC
(In reply to Jeroen Roovers from comment #4)
> Created attachment 445194 [details, diff] [details, diff]
> tuned-2.7.1-sysctl.patch
> 
> Obviously we can change that path, but can we be sure sysctl will always be
> there?

Can we do something like the below?

distutils.spawn import find_executable
sysctl = find_executable("sysctl")
Comment 7 Yarda 2016-09-15 16:30:25 UTC
Hi, I am Tuned upstream, thanks for catching the problem. I think the proposed patch is OK, the /usr/sbin/ should probably work in the most cases. But maybe we could even go without the hardcoded path. Tuned needs root and if somebody could alter the PATH environment variable it's receiving or executables on that path, there would be probably more serious issues witch such system. Any opinions?
Comment 8 Yixun Lan archtester gentoo-dev 2016-09-18 02:44:37 UTC
Yes, I also prefer no hardcoded path

better leave the permission controlling out of the package (the policy part)
Comment 10 Yixun Lan archtester gentoo-dev 2016-10-11 08:31:51 UTC
closed this, thanks all!