404

[ Avaa Bypassed ]




Upload:

Command:

elspacio@3.147.86.30: ~ $
3

�<�e4�@snddlmZddlTddlZddlmZddlmZddlj	Z	ddl
Z
ddlZejj
�ZGdd�dej�ZdS)	�)�base)�*�N)�
exceptions)�commandscs�eZdZdZ�fdd�Zdd�Zdd�Zedd	��Zd
d�Z	dd
�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zejfdd�Zdd�Zeddd�dd ��Z�ZS)!�
SystemdPlugina<
	`systemd`::
	
	Plug-in for tuning systemd options.
	+
	The [option]`cpu_affinity` option allows setting CPUAffinity in
	`/etc/systemd/system.conf`. This configures the CPU affinity for the
	service manager as well as the default CPU affinity for all forked
	off processes. The option takes a comma-separated list of CPUs with
	optional CPU ranges specified by the minus sign (`-`).
	+
	.Set the CPUAffinity for `systemd` to `0 1 2 3`
	====
	----
	[systemd]
	cpu_affinity=0-3
	----
	====
	+
	NOTE: These tunings are unloaded only on profile change followed by a reboot.
	cs<tjjtj�stjdtj��tt|�j	||�t
�|_dS)NzERequired systemd '%s' configuration file not found, disabling plugin.)�os�path�isfile�consts�SYSTEMD_SYSTEM_CONF_FILErZNotSupportedPluginException�superr�__init__r�_cmd)�self�args�kwargs)�	__class__��$/usr/lib/python3.6/plugin_systemd.pyr$szSystemdPlugin.__init__cCsd|_d|_dS)NFT)Z_has_dynamic_tuningZ_has_static_tuning)r�instancerrr�_instance_init*szSystemdPlugin._instance_initcCsdS)Nr)rrrrr�_instance_cleanup.szSystemdPlugin._instance_cleanupcCsddiS)N�cpu_affinityr)�clsrrr�_get_config_options1sz!SystemdPlugin._get_config_optionscCsB|dk	r>tjd|d|tjd�}|dk	r>|jdkr>|jd�SdS)Nz^\s*z\s*=\s*(.*)$)�flagsr)�re�search�	MULTILINE�	lastindex�group)r�conf�key�morrr�_get_keyval7s

zSystemdPlugin._get_keyvalcCs~tjd|ddt|�|tjd�\}}|dkrzy|ddkrF|d7}Wntk
r\YnX||dt|�d7}|S|S)	Nz^(\s*z\s*=).*$z\g<1>)rr�
�=���)r�subn�strr�
IndexError)rr"r#�valZconf_newZnsubsrrr�_add_keyval?s(zSystemdPlugin._add_keyvalcCstjd|dd|tjd�S)Nz^\s*z\s*=.*\n�)r)r�subr)rr"r#rrr�_del_keyKszSystemdPlugin._del_keycCs,|jjtjdd�}|dkr(tjd�dS|S)N)�err_retz(error reading systemd configuration file)r�	read_filerr�log�error)rZsystemd_system_confrrr�_read_systemd_system_confNs

z'SystemdPlugin._read_systemd_system_confcCsptjtj}|jj||�s8tjd�|jj|dd�dS|jj|tj�sltjdtj�|jj|dd�dSdS)Nz(error writing systemd configuration fileT)�no_errorFz/error replacing systemd configuration file '%s')	rrZTMP_FILE_SUFFIXr�
write_to_filer3r4�unlink�rename)rr"Ztmpfilerrr�_write_systemd_system_confUs
z(SystemdPlugin._write_systemd_system_confcCstjjtj|j�S)N)rr	�joinrZPERSISTENT_STORAGE_DIR�name)rrrr�_get_storage_filenamecsz#SystemdPlugin._get_storage_filenamecCsl|j�}|dk	rh|j�}|jj|ddd�}|jj|�|dkrN|j|tj�}n|j|tj|�}|j	|�dS)NT)r1r6)
r5r=rr2r8r0r�SYSTEMD_CPUAFFINITY_VARr-r:)rr"�fname�cpu_affinity_savedrrr�_remove_systemd_tuningfsz$SystemdPlugin._remove_systemd_tuningcCs0|tjkr,tjdtj�|j�tjd�dS)Nz6removing '%s' systemd tuning previously added by TuneDz[you may need to manualy run 'dracut -f' to update the systemd configuration in initrd image)rZ
ROLLBACK_FULLr3�infor>rAZconsole)rrZrollbackrrr�_instance_unapply_staticrs
z&SystemdPlugin._instance_unapply_staticc
Cs<|dkrdSdjdd�|jjtjddtjdd|���D��S)Nr.� css|]}t|�VqdS)N)r*)�.0�vrrr�	<genexpr>|sz8SystemdPlugin._cpulist_convert_unpack.<locals>.<genexpr>z\s+�,z,\s+)r;r�cpulist_unpackrr/)rZcpulistrrr�_cpulist_convert_unpackysz%SystemdPlugin._cpulist_convert_unpackrF)Z
per_devicecCs�d}d}|jj|jj|jj|���}djdd�|jj|�D��}|j�}	|	dk	rh|j|	t	j
�}|j|�}|r||jd|||�S|r�|j
�}
|jj|
ddd�}|dk	r�|dkr�||kr�|jj|
|dd�tjdt	j
|t	jf�|j|j|	t	j
|��dS)	NrDcss|]}t|�VqdS)N)r*)rErFrrrrG�sz)SystemdPlugin._cmdline.<locals>.<genexpr>rT)r1r6)Zmakedirz setting '%s' to '%s' in the '%s')rZunescapeZ
_variables�expandZunquoter;rIr5r%rr>rJZ
_verify_valuer=r2r7r3rBrr:r-)rZenabling�valueZverifyZignore_missingZ
conf_affinityZconf_affinity_unpackedrFZ
v_unpackedr"r?r@rrr�_cmdline~s"
zSystemdPlugin._cmdline)�__name__�
__module__�__qualname__�__doc__rrr�classmethodrr%r-r0r5r:r=rArZ
ROLLBACK_SOFTrCrJZcommand_customrM�
__classcell__rr)rrr
sr)r.rZ
decoratorsZ
tuned.logsZtunedrZtuned.utils.commandsrZtuned.constsrrrZlogs�getr3ZPluginrrrrr�<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