404

[ Avaa Bypassed ]




Upload:

Command:

elspacio@3.139.86.53: ~ $
3

�<�e=�@sjddlZddlZddlmZddlTddlZddlTddl	m
Z
ddljZej
j�ZGdd�dej�ZdS)�N�)�base)�*)�commandscsfeZdZdZ�fdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
ejfdd�Z
dd�Z�ZS)�
ModulesPlugina!
	`modules`::
	
	Plug-in for applying custom kernel modules options.
	+
	This plug-in can set parameters to kernel modules. It creates
	`/etc/modprobe.d/tuned.conf` file. The syntax is
	`_module_=_option1=value1 option2=value2..._` where `_module_` is
	the module name and `_optionx=valuex_` are module options which may
	or may not be present.
	+
	.Load module `netrom` with module parameter `nr_ndevs=2`
	====
	----
	[modules]
	netrom=nr_ndevs=2
	----
	====
	Modules can also be forced to load/reload by using an additional
	`+r` option prefix.
	+
	.(Re)load module `netrom` with module parameter `nr_ndevs=2`
	====
	----
	[modules]
	netrom=+r nr_ndevs=2
	----
	====
	The `+r` switch will also cause *TuneD* to try and remove `netrom`
	module (if loaded) and try and (re)insert it with the specified
	parameters. The `+r` can be followed by an optional comma (`+r,`)
	for better readability.
	+
	When using `+r` the module will be loaded immediately by the *TuneD*
	daemon itself rather than waiting for the OS to load it with the
	specified parameters.
	cs$tt|�j||�d|_t�|_dS)NT)�superr�__init__Z_has_dynamic_optionsr�_cmd)�self�args�kwargs)�	__class__��$/usr/lib/python3.6/plugin_modules.pyr3szModulesPlugin.__init__cCsd|_d|_|j|_dS)NFT)Z_has_dynamic_tuningZ_has_static_tuningZoptions�_modules)r
�instancerrr�_instance_init8szModulesPlugin._instance_initcCsdS)Nr)r
rrrr�_instance_cleanup=szModulesPlugin._instance_cleanupcCs�x�|D]�}|jjdd|g�\}}|dkr6tjd�dS|dkrTtjd||j�f�|jjd|g�\}}|dkrtjd||j�f�qWdS)NZmodprobez-rrzN'modprobe' command not found, cannot reload kernel modules, reboot is requiredz$cannot remove kernel module '%s': %sz:cannot insert/reinsert module '%s', reboot is required: %s)r	�execute�log�warn�debug�strip)r
�modules�module�retcode�outrrr�_reload_modules@s

zModulesPlugin._reload_modulescCsR|j�d}d}d}g}x�t|jj��D]�\}}|jj|�}|jj|�}	|s�|jjd|g�\}}
|dkrxd}tj	d�n|dkr�tj
d|�|s�|dkr(t|	�dkr�|	dd	�d
kr�tj
dd|	�}	|j|�t|	�dkr�|d|d
|	d7}q(tjd|�q(W|jjtj|�t|�}|dk�rN|j|�t|j�|k�rNtjtj�dS)N�rFZmodinfoTz8'modinfo' command not found, not checking kernel modulesz)kernel module '%s' not found, skipping itr�z+rz^\s*\+r\s*,?\s*zoptions � �
zKmodule '%s' doesn't have any option specified, not writing it to modprobe.d)�_clear_modprobe_file�listr�items�
_variables�expandr	rrr�error�len�re�sub�appendr�
write_to_file�consts�MODULES_FILEr�infoZSTR_HINT_REBOOT)r
r�srZ
skip_checkZreload_list�option�valuer�vr�lrrr�_instance_apply_staticLs8


z$ModulesPlugin._instance_apply_staticcCst|�jdd�S)N�/r)�str�replace)r
�pathrrr�
_unquote_pathkszModulesPlugin._unquote_pathc
Csd}d}tjd�}�xt|jj��D]�\}}|jj|�}|jj|�}	tjdd|	�}	d|}
tj	j
|
�s�d}tjt
jd|�q$tjt
jd|�|j|	�}xv|D]n}|jd	�}
t|
�d
kr�tjd||f�q�|j|
d|
d
|jj|
d|j|
d�ddd�|�dkr�d}q�Wq$W|S)NTz\s+z^\s*\+r\s*,?\s*rz/sys/module/%sFzmodule '%s' is not loadedzmodule '%s' is loaded�=rz.unrecognized module option for module '%s': %srrz/parameters/)Zerr_ret�no_error)r)�compiler#rr$r%r&r*�osr9�existsrr'r-ZSTR_VERIFY_PROFILE_FAILr/ZSTR_VERIFY_PROFILE_OK�splitr(rZ
_verify_valuer	�	read_filer:)r
rZignore_missingZdevices�ret�rr1r2rr3Zmpathr4�item�argrrr�_instance_verify_staticns,



"
z%ModulesPlugin._instance_verify_staticcCs|tjkr|j�dS)N)r-Z
ROLLBACK_FULLr")r
rZrollbackrrr�_instance_unapply_static�s
z&ModulesPlugin._instance_unapply_staticcCs�|jjtjdd�}|jd�}d}}t|�}tjd�}x.||krd|j||�dkrZ|}|}|d7}q8Wdj	|d|��}t|�dkr�|d7}|jj
tj|�dS)NT)r<r!rz^\s*#r)r	rAr-r.r@r(r)r=�search�joinr,)r
r0r4�i�jZllrCrrrr"�s


z"ModulesPlugin._clear_modprobe_file)�__name__�
__module__�__qualname__�__doc__rrrrr5r:rFr-Z
ROLLBACK_SOFTrGr"�
__classcell__rr)r
rrs%r)r)Zos.pathr>rrZ
decoratorsZ
tuned.logsZtuned�
subprocessZtuned.utils.commandsrZtuned.constsr-Zlogs�getrZPluginrrrrr�<module>s



Filemanager

Name Type Size Permission Actions
__init__.cpython-36.opt-1.pyc File 173 B 0644
__init__.cpython-36.pyc File 173 B 0644
base.cpython-36.opt-1.pyc File 21.13 KB 0644
base.cpython-36.pyc File 21.13 KB 0644
decorators.cpython-36.opt-1.pyc File 1.06 KB 0644
decorators.cpython-36.pyc File 1.06 KB 0644
exceptions.cpython-36.opt-1.pyc File 354 B 0644
exceptions.cpython-36.pyc File 354 B 0644
hotplug.cpython-36.opt-1.pyc File 4.23 KB 0644
hotplug.cpython-36.pyc File 4.23 KB 0644
plugin_acpi.cpython-36.opt-1.pyc File 3.35 KB 0644
plugin_acpi.cpython-36.pyc File 3.35 KB 0644
plugin_audio.cpython-36.opt-1.pyc File 4.03 KB 0644
plugin_audio.cpython-36.pyc File 4.03 KB 0644
plugin_bootloader.cpython-36.opt-1.pyc File 24.45 KB 0644
plugin_bootloader.cpython-36.pyc File 24.45 KB 0644
plugin_cpu.cpython-36.opt-1.pyc File 26.03 KB 0644
plugin_cpu.cpython-36.pyc File 26.06 KB 0644
plugin_disk.cpython-36.opt-1.pyc File 16.35 KB 0644
plugin_disk.cpython-36.pyc File 16.35 KB 0644
plugin_eeepc_she.cpython-36.opt-1.pyc File 3.43 KB 0644
plugin_eeepc_she.cpython-36.pyc File 3.43 KB 0644
plugin_irqbalance.cpython-36.opt-1.pyc File 4.51 KB 0644
plugin_irqbalance.cpython-36.pyc File 4.51 KB 0644
plugin_modules.cpython-36.opt-1.pyc File 5.45 KB 0644
plugin_modules.cpython-36.pyc File 5.45 KB 0644
plugin_mounts.cpython-36.opt-1.pyc File 5.5 KB 0644
plugin_mounts.cpython-36.pyc File 5.5 KB 0644
plugin_net.cpython-36.opt-1.pyc File 23.21 KB 0644
plugin_net.cpython-36.pyc File 23.21 KB 0644
plugin_rtentsk.cpython-36.opt-1.pyc File 1.34 KB 0644
plugin_rtentsk.cpython-36.pyc File 1.34 KB 0644
plugin_scheduler.cpython-36.opt-1.pyc File 53.44 KB 0644
plugin_scheduler.cpython-36.pyc File 53.44 KB 0644
plugin_script.cpython-36.opt-1.pyc File 4.26 KB 0644
plugin_script.cpython-36.pyc File 4.31 KB 0644
plugin_scsi_host.cpython-36.opt-1.pyc File 4.56 KB 0644
plugin_scsi_host.cpython-36.pyc File 4.56 KB 0644
plugin_selinux.cpython-36.opt-1.pyc File 3 KB 0644
plugin_selinux.cpython-36.pyc File 3 KB 0644
plugin_service.cpython-36.opt-1.pyc File 13.84 KB 0644
plugin_service.cpython-36.pyc File 13.84 KB 0644
plugin_sysctl.cpython-36.opt-1.pyc File 6.7 KB 0644
plugin_sysctl.cpython-36.pyc File 6.7 KB 0644
plugin_sysfs.cpython-36.opt-1.pyc File 3.64 KB 0644
plugin_sysfs.cpython-36.pyc File 3.64 KB 0644
plugin_systemd.cpython-36.opt-1.pyc File 5.92 KB 0644
plugin_systemd.cpython-36.pyc File 5.92 KB 0644
plugin_uncore.cpython-36.opt-1.pyc File 4.75 KB 0644
plugin_uncore.cpython-36.pyc File 4.75 KB 0644
plugin_usb.cpython-36.opt-1.pyc File 2.95 KB 0644
plugin_usb.cpython-36.pyc File 2.95 KB 0644
plugin_video.cpython-36.opt-1.pyc File 4.13 KB 0644
plugin_video.cpython-36.pyc File 4.13 KB 0644
plugin_vm.cpython-36.opt-1.pyc File 4.11 KB 0644
plugin_vm.cpython-36.pyc File 4.11 KB 0644
repository.cpython-36.opt-1.pyc File 1.87 KB 0644
repository.cpython-36.pyc File 1.92 KB 0644