404

[ Avaa Bypassed ]




Upload:

Command:

elspacio@18.223.159.0: ~ $
3

�<�e��@spddljZddlmZddlTddlmZmZddlZ	ddl
mZddlZe	j
j�Ze�ZGdd�dej�ZdS)	�N�)�base)�*)�Popen�PIPE)�commandsc@steZdZdZedd��Zdd�Zedd��Zdd	�Zd
d�Z	dd
�Z
dd�Zdd�Zdd�Z
eddd�dd��ZdS)�MountsPluginaP
	`mounts`::
	
	Enables or disables barriers for mounts according to the value of the
	[option]`disable_barriers` option. The [option]`disable_barriers`
	option has an optional value `force` which disables barriers even
	on mountpoints with write back caches. Note that only extended file
	systems (ext) are supported by this plug-in.
	cCs�i}d}tdddgttddd�j�\}}x�dd�|j�D�D]�}t|�d	krNq<|dd	�\}}}t|�d	krt|d	nd}	t|�d
kr�|d
nd}
|dkr�|}q<|dks<|dkr�q<|
dks<|
dkr�q<|j|
t�||	d��||
dj|�q<W||_dS)z�
		Gets the information about disks, partitions and mountpoints. Stores information about used filesystem and
		creates a list of all underlying devices (in case of LVM) for each mountpoint.
		NZlsblkz-rnozTYPE,RM,KNAME,FSTYPE,MOUNTPOINTT)�stdout�stderrZ	close_fdsZuniversal_newlinescSsg|]}|j��qS�)�split)�.0�linerr�#/usr/lib/python3.6/plugin_mounts.py�
<listcomp>$sz>MountsPlugin._generate_mountpoint_topology.<locals>.<listcomp>��Zdisk�1�part�lvmz[SWAP])�disks�device_name�
filesystemr)rr)	rrZcommunicate�
splitlines�len�
setdefault�set�add�_mountpoint_topology)�clsZmountpoint_topologyZcurrent_diskr	r
�columnsZdevice_typeZdevice_removablerr�
mountpointrrr�_generate_mountpoint_topologys,z*MountsPlugin._generate_mountpoint_topologycCs*|j�d|_t|jj��|_t�|_dS)NT)r"Z_devices_supportedrr�keysZ
_free_devicesZ_assigned_devices)�selfrrr�
_init_devices;szMountsPlugin._init_devicescCsddiS)N�disable_barriersr)r$rrr�_get_config_optionsAsz MountsPlugin._get_config_optionscCsd|_d|_dS)NFT)Z_has_dynamic_tuningZ_has_static_tuning)r$�instancerrr�_instance_initGszMountsPlugin._instance_initcCsdS)Nr)r$r(rrr�_instance_cleanupKszMountsPlugin._instance_cleanupcCs,tjd|�}x|D]}tj|�j�SWdS)zV
		Get device cache type. This will work only for devices on SCSI kernel subsystem.
		z+/sys/block/%s/device/scsi_disk/*/cache_typeN)�glob�cmdZ	read_file�strip)r$�deviceZsource_filenamesZsource_filenamerrr�_get_device_cache_typeNs
z#MountsPlugin._get_device_cache_typecCs.x(|j|dD]}|j|�dkrdSqWdS)zr
		Checks if the device has 'write back' cache. If the cache type cannot be determined, asume some other cache.
		rz
write backTF)rr/)r$r!r.rrr�_mountpoint_has_writeback_cacheWsz,MountsPlugin._mountpoint_has_writeback_cachecCs�td��H}x@|D]4}|j�}|dddkr.q|d|kr|d}PqWdSWdQRX|jd�}xH|D]<}|jd�\}}	}
|d	ks�|d
kr�|
dkr�dS|d
krfd
SqfWd
SdS)zP
		Checks if a given mountpoint is mounted with barriers enabled or disabled.
		z/proc/mountsr�/rrN�,�=Z	nobarrierZbarrier�0FT)�openr�	partition)r$r!Zmounts_filerr Zoption_list�optionsZoption�name�sep�valuerrr�_mountpoint_has_barriers`s"



z%MountsPlugin._mountpoint_has_barrierscCsd|dd|g}tj|�dS)z
		Remounts partition.
		z/usr/bin/mountz-oz
remount,%sN)r,Zexecute)r$r6r7Zremount_commandrrr�_remount_partition}szMountsPlugin._remount_partitionr&T)Z
per_devicec
CsZ|jd|d�}t|�j�dk}|p*|j|�}|�r|s:dSd}|j|djd�sXd}nl|rn|j|�rnd}nV|j|�}	|	dkr�d}n>|	d	kr�|r�tj	t
j|�d
Sd}n|r�tjt
j
|�d	S|dk	r�tj	d||f�dS|jj||	�tj	d
|�|j|d�nJ|�rdS|jj|�}	|	dk�r0dStj	d|�|j|d�|jj|�dS)Nr&)Zcommand_namer�forcerZextzfilesystem not supportedzdevice uses write back cachezunknown current settingFTzbarriers already disabledz#not disabling barriers on '%s' (%s)zdisabling barriers on '%s'z	barrier=0zenabling barriers on '%s'z	barrier=1)Z_storage_key�str�lowerZ_option_boolr�
startswithr0r;�log�info�constsZSTR_VERIFY_PROFILE_OK�errorZSTR_VERIFY_PROFILE_FAILZ_storagerr<�getZunset)
r$�startr:r!ZverifyZignore_missingZstorage_keyr=Z
reject_reason�original_valuerrr�_disable_barriers�sN

zMountsPlugin._disable_barriersN)�__name__�
__module__�__qualname__�__doc__�classmethodr"r%r'r)r*r/r0r;r<Zcommand_customrHrrrrrs	$		r)Ztuned.constsrC�rZ
decorators�
subprocessrrZ
tuned.logsZtunedZtuned.utils.commandsrr+ZlogsrErAr,ZPluginrrrrr�<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