__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

[email protected]: ~ $
�

x[hN7��t�SrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSK	J	r	J
r
 SSKJrJ
r
JrJrJrJrJr SSKJr SSKJr SSKJrJr SSKJr SS	KJrJrJr \"\R@\RB"\"55r#"S
S\5r$\$"SS
5\$"SS5\$"SS5/r%\$"SS5\$"SS5\$"SS5\$"SS5\$"SS5\$"SS5\$"SS5\$"S S!5\$"S"S#5\$"S$S%5\$"S&S%5\$"S'S(5/r&SRS)\\RNS*\RN4S+jjr(S,\\)S-\RTS.\)S*\\)4S/jr+S,\\)S-\RTS.\)S*S4S0jr,S1\RTS2\RTS3\-S*S4S4jr.S5\RTS3\-S*S4S6jr/S5\RTS*S4S7jr0S5\RTS3\-S*S4S8jr1S9\
\)\4S*\\RT4S:jr2\RT"S;54S<\RTS*\\RT4S=jjr3S>\RTS*\\RT4S?jr4S@\RTS*\\RT4SAjr5S5\RTS9\
\)\4S@\RTS>\RTS3\-S*S4SBjr6\RT"SC5\RT"SD5SE4SF\)S9\
\)\4S@\RTS>\RTS3\-S*S4SGjjr7SH\8S*S4SIjr9SSSF\)SH\8SJ\-SK\-S*S4
SLjjr:SM\)SN\RvS*\84SOjr<\"SP:Xa-\Rz"\<"SQ\("5R}555 gg)TzGDefine 'collect-logs' utility and handler to include in cloud-init cmd.�N)�datetime�timezone)�Any�Dict�Iterator�List�
NamedTuple�Optional�cast)�loggers)�Init)�ProcessExecutionError�subp)�tempdir)�copy�get_config_logfiles�
write_filec�*�\rSrSr%\\S'\\S'Srg)�
ApportFile��path�label�N)�__name__�
__module__�__qualname__�__firstlineno__�str�__annotations__�__static_attributes__r��:/usr/lib/python3/dist-packages/cloudinit/cmd/devel/logs.pyrrs��

�I��Jr!rz(/var/log/installer/autoinstall-user-data�AutoInstallUserDataz/autoinstall.yaml�AutoInstallYAMLz'/etc/cloud/cloud.cfg.d/99-installer.cfg�InstallerCloudCfgz//var/log/installer/ubuntu_desktop_installer.log�UdiLogz-/var/log/installer/subiquity-server-debug.log�SubiquityServerDebugz-/var/log/installer/subiquity-client-debug.log�SubiquityClientDebugz%/var/log/installer/curtin-install.log�	CurtinLogz0/var/log/installer/subiquity-curtin-install.conf�CurtinInstallConfigz8/var/log/installer/curtin-install/subiquity-initial.conf�CurtinConfigInitialz:/var/log/installer/curtin-install/subiquity-curthooks.conf�CurtinConfigCurtHooksz8/var/log/installer/curtin-install/subiquity-extract.conf�CurtinConfigExtractz=/var/log/installer/curtin-install/subiquity-partitioning.conf�CurtinConfigPartitioningz(/var/log/installer/curtin-error-logs.tar�CurtinErrorz$/var/log/installer/curtin-errors.tarz(/var/log/installer/block/probe-data.json�	ProbeData�parser�returnc	���U(d[R"SSS9nURSSSSSS	S
9 URSSS
SS9 URSSSSSSS9 URSSSSSS9 U$)aBuild or extend and arg parser for collect-logs utility.

@param parser: Optional existing ArgumentParser instance representing the
    collect-logs subcommand which will be extended to support the args of
    this utility.

@returns: ArgumentParser with proper argument configuration.
zcollect-logsz)Collect and tar all cloud-init debug info)�prog�descriptionz	--verbosez-v�countr�	verbosityzBe more verbose.)�action�default�dest�helpz	--tarfilez-tzcloud-init.tar.gzzOThe tarfile to create containing all collected logs. Default: cloud-init.tar.gz)r9r;z--include-userdataz-uF�
store_true�userdataz?DEPRECATED: This is default behavior and this flag does nothing)r9r8r:r;z--redact-sensitivez-rz�Redact potentially sensitive data from logs. Sensitive data may include passwords or keys in user data and root read-only files.)r9r8r;)�argparse�ArgumentParser�add_argument)r1s r"�
get_parserrAOs�����(�(��C�
���������
�
�
�������#�
*����������
�M��	��������
$�
�
��Mr!�cmd�	file_path�msgc�F�URRSSS9 [U5Rn[	X5 [
R
SX!R5 U$![a8n[	U[U55 [
R
SU5 SnSnAU$SnAff=f)zCHelper which runs a command and writes output or error to filename.T��parents�exist_ok�collected %s to file '%s'�collecting %s failed.N)
�parent�mkdirr�stdoutr�LOG�debug�stemrr)rBrCrD�output�es     r"�_write_command_output_to_filerS�s��������4�$��7�D��c��!�!��	�9�%��	�	�-�s�N�N�C��M��!���9�c�!�f�%��	�	�)�3�/����M���s�A�
B �(-B�B c�~�URRSSS9 URS5n[R"XUS9 SSS5 [
R
SX!R5 g!,(df   N/=f![a5n[U[U55 [
R
SU5 SnAgSnAff=f)z�Helper which runs a command and writes output or error to filename.

`subprocess.call` is invoked directly here to stream output to the file.
Otherwise memory usage can be high for large outputs.
TrF�w)rM�stderrNrIrJ)rKrL�open�
subprocess�callrNrOrP�OSErrorrr)rBrCrD�frRs     r"�_stream_command_output_to_filer\�s��������4�$��7�D�
�^�^�C�
 �A��O�O�C�!�4�!�	�	�	�-�s�N�N�C�
!�
 ���0��9�c�!�f�%��	�	�)�3�/�/��0�s.�A=�A,�A=�,
A:�6A=�=
B<�+B7�7B<r�out_dir�include_sensitivec�Z�UR5(a�U(d0UR5R[R-(a2UR	SSS9 [X5 [RSU5 g[RSU5 g[RSU5 g)z-Collect a file into what will be the tarball.TrFzcollected file: %sz#sensitive file %s was not collectedzfile %s did not existN)	�is_file�stat�st_mode�S_IROTHrLrrNrO�trace)rr]r^s   r"�
_collect_filere�sn���|�|�~�~���	�	�� 3� 3�d�l�l� B��M�M�$��M�6�����I�I�*�D�1��I�I�;�T�B��	�	�)�4�0r!�log_dirc��[HYn[R"XRSS5Rn[[R"UR5USS9 M[ U(ad[HYn[R"XRSS5Rn[[R"UR5USS9 M[ gg)z'Obtain subiquity logs and config files.�NT)r^)�INSTALLER_APPORT_FILES�pathlib�PathrrKre� INSTALLER_APPORT_SENSITIVE_FILES)rfr^�src_file�destination_dirs    r"�_collect_installer_logsro�s���+��!�,�,�w�
�
�a�b�0A�B�I�I����L�L����'��"�	
�+��8�H�%�l�l�7�M�M�!�"�4E�F�M�M�O�����X�]�]�+��"&�
�9�r!c�j�[SS/US-SS9n[/SQUS-SS9nU(dU=(d S	ng
g
)z8Include cloud-init version and dpkg version in the logs.�
cloud-initz	--version�versionzcloud-init --version�rBrCrD)z
dpkg-queryz--showz-f=${Version}
rqzdpkg-versionzdpkg versionz
not-availableN)rS)rfrr�dpkg_vers   r"�_collect_version_inforu�sM��+�
�;�'��I�%�"��G�
-�E��N�*���H�
��-�o��r!c��U(a[S/US-SS9 [/SQUS-SS9 [/SQ[R"US	5S
S9 g)z0Include dmesg and journalctl output in the logs.�dmesgz	dmesg.txtzdmesg outputrs)�
journalctlz--boot=0�-o�
short-precisezjournal.txtzsystemd journal of current boot)rxz	--boot=-1ryrzzjournal-previous.txtz systemd journal of previous bootN)r\rjrk)rfr^s  r"�_collect_system_logsr{�sV���&��	���+��	
�
#�=��M�)�-��
#�>��,�,�w�(>�?�.�r!�log_cfgc#�`# �[U5Hn[R"U5v� M g7f)z7Get paths for cloud-init.log and cloud-init-output.log.N)rrjrk)r|rs  r"�_get_cloudinit_logsr~�s%���$�G�,���l�l�4� � �-�s�,.z
/etc/cloud�
etc_cloud_dirc#�n^# �US-US-S/mU4SjURS55Shv�N gN7f)z�Get paths for all files in /etc/cloud.

Excludes:
  /etc/cloud/keys because it may contain non-useful sensitive data.
  /etc/cloud/templates because we already know its contents
�keys�	templatesz99-installer.cfgc3�p># �UH+nURT;dMURT;dM'Uv� M- g7f�N)�namerK)�.0r�ignores  �r"�	<genexpr>�!_get_etc_cloud.<locals>.<genexpr>s7�����.�D��9�9�F�"�	
�'+�{�{�&�'@�	
��.�s�6�6�	6z**/*N��glob)rr�s @r"�_get_etc_cloudr�sD����	�����#��	�F��!�&�&�v�.����s�*5�3�5�	cloud_dirc	���[R"URS5URS5URS5SURS55URS55$)zcGet paths for files in /var/lib/cloud.

Skip user-provided scripts, semaphores, and old instances.
zdata/*z
handlers/*zseed/*c3�R# �UHoR5(dMUv� M g7fr�)r`)r��ps  r"r��%_get_var_lib_cloud.<locals>.<genexpr>s���@�0�q�I�I�K���0�s�'�	'z
instance/*zinstance/handlers)�	itertools�chainr��r�s r"�_get_var_lib_cloudr�sW��
�?�?����x� ����|�$����x� �@�I�N�N�<�0�@����*�+��r!�run_dirc�$�URS5$)z�Get all paths under /run/cloud-init except for hook-hotplug-cmd.

Note that this only globs the top-level directory as there are currently
no relevant files within subdirectories.
�*r��r�s r"�_get_run_dirr�$s���<�<���r!c���[U5 [X5 [X5 [U5H@n[	UU[
R"U5RRS5-S5 MB [R"[5[US9[US95H@n[	UU[
R"U5RRS5-U5 MB g)z8Collect all cloud-init logs into the provided directory.�/Tr�r�N)rur{ror~rerjrkrK�relative_tor�r�r�r�r�)rfr|r�r�r^�logfiles      r"�_collect_logs_into_tmp_dirr�-s����'�"���4��G�7�&�w�/��	���g�l�l�7�+�2�2�>�>�s�C�C��	
�	0��?�?����Y�/��W�%���
	���g�l�l�7�+�2�2�>�>�s�C�C��	
�r!z/run/cloud-initz/var/lib/cloudT�tarfilec���[RRU5n[R"[
R5R5RS5n[US9n[R"Xe5n[UUUUUS9 [SSUSU[U5RUS3S5/5 S	S	S	5 [ R#S
U5 g	!,(df   N%=f)a�Collect all cloud-init logs and tar them up into the provided tarfile.

:param tarfile: The path of the tar-gzipped file to create.
:param log_cfg: The cloud-init base configuration containing logging cfg.
:param run_dir: The path to the cloud-init run directory.
:param cloud_dir: The path to the cloud-init cloud directory.
:param include_sensitive: Boolean, true means include sensitive data.
zcloud-init-logs-%Y-%m-%d)�dir)rfr|r�r�r^�tar�czfz-Cr��NzWrote %s)�osr�abspathr�nowr�utc�date�strftimerrjrkr�rr�replacerN�info)r�r|r�r�r^�dir_name�tmp_dirrfs        r"�collect_logsr�Ns����g�g�o�o�g�&�G����X�\�\�"�'�'�)�2�2�3M�N�
�
�W�	���,�,�w�1��"�����/�	
�	
�������G��$�$��y��]�B�7�

�		
�
�&�H�H�Z��!�'
�	�s
�*AC�
C(r7c�r�[R"5 US:Xa[RnO'US:Xa[RnO[R
n[RU5 [R"5nUR[R"S55 [RU5 g)z�Set up the logger for CLI use.

The verbosity controls which level gets printed to stderr. By default,
DEBUG and TRACE are hidden.
rrhz%(message)sN)r�
reset_logging�logging�INFO�DEBUG�TRACErN�setLevel�
StreamHandler�setFormatter�	Formatter�
addHandler)r7�level�handlers   r"�
_setup_loggerr�wsx�������A�~�����	�a���
�
���
�
���L�L����#�#�%�G�����*�*�=�9�:��N�N�7�r!�redact_sensitive�include_userdatac���[U5 [R"5S:wa[S5eU(a[RS5 [
/S9nUR5 [UUR[R"URR5[R"URR5U(+S9 U(d[RS5 gg)z:Handle calls to 'cloud-init collect-logs' as a subcommand.rz!This command must be run as root.z;The --include-userdata flag is deprecated and does nothing.)�ds_deps)r�r|r�r�r^z�WARNING:
Sensitive data may have been included in the collected logs.
Please review the contents of the tarball before sharing or
rerun with --redact-sensitive to redact sensitive data.N)r�r��getuid�RuntimeErrorrN�warningr
�read_cfgr��cfgrjrk�pathsr�r�)r�r7r�r��inits     r"�collect_logs_clir��s����)��	�y�y�{�a���>�?�?�����I�	
����D��M�M�O���������T�Z�Z�/�/�0��,�,�t�z�z�3�3�4�.�.������
F�	
�r!�_name�argsc��[5R5n[URURUR
URS9 g![a"n[U[RS9 SnAgSnAff=f)zuHandle the CLI interface to the module.

Parse CLI args, redirect all exceptions to stderr, and return an exit code.
)r7r�r�r�r)�fileNrh)rA�
parse_argsr�r7r�r�r=�	Exception�print�sysrV)r�r�rRs   r"�handle_collect_logs_argsr��se��
�<�"�"�$�D�
���n�n��L�L�!�2�2�!�]�]�		
�����
�a�c�j�j�!����s�4A�
A;�A6�6A;�__main__r�r�)rTF)?�__doc__r>r�r�r�rjrarXr�rr�typingrrrrr	r
r�
cloudinit.logr�cloudinit.stagesr
�cloudinit.subprr�cloudinit.temp_utilsr�cloudinit.utilrrr�CustomLoggerType�	getLoggerrrNrrlrir?rArrkrSr\�boolrerorur{r~r�r�r�r�r��intr�r��	Namespacer��exitr�rr!r"�<module>r�s]��N����	����
�'�H�H�H�!�!�6�(�@�@�
�7�#�#�W�%6�%6�x�%@�A������2�4I���"�$5�6��8�:M�N�$� ��@�(�K��7�9O���7�9O���6��D��:����B����D����B����G�"��
�9�=�I��5�}�E��9�;�G�C"��L15�6��X�,�,�-�6�
���6�r�	
�c����|�|��

���c�]�	�&D�	
�c��D�&�|�|�D�25�D�	�D�&1�
�,�,�1�!(���1�BF�1�	�1��
�\�\��.2��	��*
.�7�<�<�
.�D�
.� �
�\�\��.2��	��,!�
�#�s�(�^�!�
�g�l�l��!�#*�,�,�|�"<���<�<��
�g�l�l���,�'�,�,��8�G�L�L�3I���'�,�,��8�G�L�L�+A��
�
�\�\�
�
�#�s�(�^�
��\�\�
��|�|�	
�
�
�
�

�H$�L�L�):�;�%�l�l�+;�<�"�&"�
�&"�
�#�s�(�^�&"��\�\�&"��|�|�	&"�
�&"�
�
&"�R�S��T��*�!�"�	
�
�
��
��
��	
�

�
�B�C��x�/A�/A��c��&�z���H�H�
%�b�*�,�*A�*A�*C�
D�E�r!

Filemanager

Name Type Size Permission Actions
__init__.cpython-313.pyc File 1.14 KB 0644
hotplug_hook.cpython-313.pyc File 15.97 KB 0644
logs.cpython-313.pyc File 17.96 KB 0644
make_mime.cpython-313.pyc File 5.4 KB 0644
net_convert.cpython-313.pyc File 7.52 KB 0644
parser.cpython-313.pyc File 1.76 KB 0644
render.cpython-313.pyc File 4.53 KB 0644
Filemanager