+
    Û1jØ>  ã                   óÆ   € ^ RI t ^ RIt^ RIHt ^ RIHt ^ RIHt ^ RI	H
t
 ^ RIHt ^ RIHt ^ RIHt ^ R	IHt ^ R
IHtHtHtHt RtRtRt ! R R]4      t ! R R]4      tR# )é    N)Ú_sos)ÚPolicy)Ú
InitSystem)ÚSystemdInit)ÚCrioContainerRuntime)ÚPodmanContainerRuntime)ÚDockerContainerRuntime)ÚLxdContainerRuntime)Ú	shell_outÚis_executableÚboldÚsos_get_command_outputz/etc/os-releaseÚ	containerÚHOSTc                   ó<  a a€ ] tR t^#t oRtRtRtRtRtRt	Rt
RtRtRtRtRtRtRtRtR	tRtRtR"V 3R
 llt]R 4       t]R#R l4       tR tR tR tR tR tR t]R 4       t ]R 4       t!]R 4       t"R t#R t$R t%R t&R t'R t(R t)R t*R$R lt+R t,R  t-R!t.Vt/V ;t0# )%ÚLinuxPolicyzbThis policy is meant to be an abc class that provides common
implementations used in Linux distrosÚNonez/bin:/sbin:/usr/bin:/usr/sbinNÚ ÚdockerFz/usr/binzsos-collector-tmpc                ó&  <€ \         SV `  VVVR 7       V'       d   Wn        MV P                  4       ;'       g    RV n        V P	                  4        Ve   W n        MP\        P                  P                  R4      '       d   \        V P                  R7      V n        M\        4       V n        / V n        V P                  '       EdK   \        V R7      \        V R7      \        V R7      \!        V R7      .pV F£  pVP#                  4       '       g   K  W`P                  VP$                  &   VP$                  V P&                  8X  d+   V P                  VP$                  ,          V P                  R&   V P                  VP$                  ,          P)                  4        K¥  	  V P                  '       d`   RV P                  9  dM   \+        V P                  P-                  4       4      pV P                  V^ ,          ,          V P                  R&   R# R# R# R# ))ÚsysrootÚprobe_runtimeÚremote_execÚ/Nz/run/systemd/system/)Úchroot)ÚpolicyÚdefault)ÚsuperÚ__init__r   Ú_container_initÚinit_kernel_modulesÚinit_systemÚosÚpathÚisdirr   r   Úruntimesr   r   r	   r   r
   Úcheck_is_activeÚnameÚdefault_container_runtimeÚload_container_infoÚlistÚkeys)	Úselfr   Úinitr   r   Ú_crunÚruntimeÚidxÚ	__class__s	   &&&&&   €Ú?/usr/lib/python3/dist-packages/sos/policies/distros/__init__.pyr   ÚLinuxPolicy.__init__;   sˆ  ø€ ä‰Ñ Ø'4Ø%0ð 	ô 	2÷ Ø"�Là×/Ñ/Ó1×8Ð8°SˆDŒLà× Ñ Ô"àÒØ#ÕÜ�W‰W�]‰]Ð1×2Ò2Ü*°$·,±,Ô?ˆDÕä)›|ˆDÔàˆŒØ××Ñä&¨dÔ3Ü&¨dÔ3Ü$¨DÔ1Ü#¨4Ô0ð	ˆEó !�Ø×*Ñ*×,Ô,Ø29—M‘M '§,¡,Ñ/Ø—|‘| t×'EÑ'EÔEØ37·=±=ÀÇÁÕ3N˜Ÿ™ iÑ0Ø—M‘M '§,¡,Õ/×CÑCÖEñ !ð �}�}ˆ} °$·-±-Ô!?ô ˜4Ÿ=™=×-Ñ-Ó/Ó0�Ø+/¯=©=¸¸Q½Õ+@�—‘˜iÓ(ñ	 "@‰}ñ ó    c                ó
   € R R.# )z/etc/passwdz/etc/shadow© )Úclss   &r3   Úset_forbidden_pathsÚLinuxPolicy.set_forbidden_pathsd   s   € ð Øð
ð 	
r5   c                ó  a € V 3R lpV'       d	   V! V4      # \         P                  P                  S P                  4      '       du   \         P                  P	                  S P                  4      \         P                  P	                  \         P                  P                  S P                  4      4      8X  d   R# \        \        RRR7      ;_uu_ 4       pV! VP                  4       4      uuRRR4       #   + '       g   i     R# ; i)úd
This function is responsible for determining if the underlying system
is supported by this policy.
c                 óJ  <€ SP                   .pSP                  '       d   VP                  SP                  4       V P                  4        FS  pVP	                  R4      '       g   K  VP                  R4      R,          ^ ,          P                  R4      pW19   g   KR   R# 	  R# )úNAME=Ú=ºé   NNz"'TF)r>   zID=)Úos_release_nameÚos_release_idÚappendÚ
splitlinesÚ
startswithÚsplitÚstrip)ÚcontentÚ_matchesÚlineÚ_distror8   s   &   €r3   Ú_check_releaseÚ)LinuxPolicy.check.<locals>._check_releaseq   s‚   ø€ Ø×+Ñ+Ð,ˆHØ× × Ð Ø—‘ × 1Ñ 1Ô2Ø×*Ñ*Ö,�Ø—?‘?Ð#3×4Ô4Ø"Ÿj™j¨›o¨bÕ1°!Õ4×:Ñ:¸5ÓA�GØÖ*Ú#ñ	 -ñ
 r5   TÚrúutf-8©ÚencodingN)	r#   r$   ÚisfileÚos_release_fileÚbasenameÚrealpathÚopenÚ
OS_RELEASEÚread)r8   ÚremoterM   Úfs   f&  r3   ÚcheckÚLinuxPolicy.checkk   s©   ø€ õ		÷ Ù! &Ó)Ð)ô �G‰G�N‰N˜3×.Ñ.×/Ò/Ü�G‰G×Ñ˜S×0Ñ0Ó1Ü—7‘7×#Ñ#¤B§G¡G×$4Ñ$4°S×5HÑ5HÓ$IÓJôKáä”*˜c¨G×4Õ4¸Ù! !§&¡&£(Ó+÷ 5×4×4Ó4ús   ÃC6Ã6D	c                ó   € V P                   # ©N)Úrelease©r-   s   &r3   Úkernel_versionÚLinuxPolicy.kernel_versionˆ   ó   € Ø�|‰|Ðr5   c                ó   € V P                   # r_   )Úhostnamera   s   &r3   Ú	host_nameÚLinuxPolicy.host_name‹   s   € Ø�}‰}Ðr5   c                ó   € V P                   # r_   )Úsmpra   s   &r3   Úis_kernel_smpÚLinuxPolicy.is_kernel_smpŽ   s   € Ø�x‰xˆr5   c                ó   € V P                   # r_   )Úmachinera   s   &r3   Úget_archÚLinuxPolicy.get_arch‘   rd   r5   c                ó"   € V P                  4       # )z)Returns the name usd in the pre_work step)rg   ra   s   &r3   Úget_local_nameÚLinuxPolicy.get_local_name”   s   € à�~‰~ÓÐr5   c                ó2   € \         P                  ! R RV4      # )z[^-a-z,A-Z.0-9]r   )ÚreÚsub)r-   r(   s   &&r3   Úsanitize_filenameÚLinuxPolicy.sanitize_filename˜   s   € Ü�vŠvÐ(¨"¨dÓ3Ð3r5   c                ó    € V \         8X  d   V P                  V4       R# VP                  V P                   R 24       V P	                  V4       R# )z Distribution PolicyN)r   Údisplay_self_helpÚ	set_titlerB   Údisplay_distro_help©r8   Úsections   &&r3   Údisplay_helpÚLinuxPolicy.display_help›   sC   € à”+ÔØ×!Ñ! 'Ö*à×Ñ ×!4Ñ!4Ð 5Ð5IÐJÔKØ×#Ñ# GÖ,r5   c                óJ   € VP                  R 4       VP                  R4       R# )zSoS Distribution Policiesz…Distributions supported by SoS will each have a specific policy defined for them, to ensure proper operation of SoS on those systems.N)r{   Úadd_textr}   s   &&r3   rz   ÚLinuxPolicy.display_self_help£   s$   € à×ÑÐ5Ô6Ø×Ñðö	
r5   c           	     óˆ  € V P                   '       d;   V P                   \        P                   Jd   VP                  V P                   4       MVP                  R 4       V ! RRR4      pVP                  RVP                   24       VP                  RVP                   2RR7       VP                  RVP
                   2RR7       VP                  R4      pV P                   F-  pVP                  RR	 V^ ,          R
 V^,          R 2RR7       K/  	  VP                  R4      pVP                  \        RR	 RR RR RR
 24      RR7       VP                  P                  4        FW  w  rgRP                  VP                  P                  4       4      pVP                  RR	 VR VP                  R VR
 2RR7       KY  	  R# )z;
Detailed help information for this policy is not availableNFzDefault --upload location: zDefault container runtime: )Únewlinez $PATH used when running report: zReference URLsÚ z>8z<30z<40z#Presets Available With This Policy
zPreset Namez<20ÚDescriptionz<45zEnabled Options)Ú__doc__r   r‚   Ú_upload_urlr)   ÚPATHÚadd_sectionÚvendor_urlsr   ÚpresetsÚitemsÚjoinÚoptsÚto_argsÚdesc)	r8   r~   Ú_polÚrefsecÚurlÚpresecÚpresetÚvalueÚ_optss	   &&       r3   r|   ÚLinuxPolicy.display_distro_help¬   sÇ  € à�;�;ˆ;˜3Ÿ;™;¬k×.AÑ.AÓAØ×Ñ˜SŸ[™[Õ)à×ÑØNôñ �4˜˜uÓ%ˆØ×ÑØ)¨$×*:Ñ*:Ð);Ð<ô	
ð 	×ÑØ)¨$×*HÑ*HÐ)IÐJØð 	ô 	
ð 	×ÑØ.¨t¯y©y¨kÐ:Øð 	ô 	
ð
 ×$Ñ$Ð%5Ó6ˆØ—?”?ˆCØ�O‰O˜s 2˜h s¨1¥v¨c l°3°qµ6¸#°,Ð?ÈˆOÖOñ #ð ×$Ñ$Ð%KÓLˆØ�‰ÜØ�r�(˜=¨Ð-¨m¸CÐ-@Ø$ SÐ)ð+óð ð 	ô 	
ð "Ÿ\™\×/Ñ/Ö1‰MˆFØ—H‘H˜UŸZ™Z×/Ñ/Ó1Ó2ˆEØ�O‰OØ�r�(˜6 #˜, u§z¡z°#Ð&6°u¸S°kÐBØð ö ó 2r5   c                óÐ  € \         \        P                  9   dÍ   \        P                  \         ,          R9   d­   RV n        \        \        P                  9   d�   \        P                  \        ,          '       g   R# \        P
                  P                  \        P                  \        ,          V P                  ,           4      V n        \        P                  \        ,          # R# )zpCheck if sos is running in a container and perform container
specific initialisation based on ENV_HOST_SYSROOT.
TN)r   ÚociÚpodman)ÚENV_CONTAINERr#   ÚenvironÚ_in_containerÚENV_HOST_SYSROOTr$   ÚabspathÚ_tmp_dirra   s   &r3   r    ÚLinuxPolicy._container_init×   sˆ   € ô œBŸJ™JÔ&Ü�z‰zœ-Õ(Ð,GÔGØ%)�Ô"Ü#¤r§z¡zÔ1ÜŸ:™:Ô&6×7Ô7á#Ü$&§G¡G§O¡OÜŸ
™
Ô#3Õ4°t·}±}ÕDó%�D”Mô Ÿ:™:Ô&6Õ7Ð7Ùr5   c                ó–  € . V n         \        P                  ! 4       P                  p\	        R^ V P
                  R7      P                  4       pV P                   P                  VR,           Uu. uF'  q3P                  4       ^ ,          P                  4       NK)  	  up4       V P                  RV R24      p \        VRRR7      ;_uu_ 4       pV FL  pVP                  R	4      R,          P                  R
4      ^ ,          pV P                   P                  V4       KN  	  RRR4       RRRR/pRT 2RT R23p	T	 F=  p
T P                  T
4      p
\        P                   P#                  T
4      '       g   K;  T
p M	  T P                  P                  R4       R# . p	 \        TRRR7      ;_uu_ 4       pT F3  pRT9   g   K  T	P                  TP                  R4      ^ ,          4       K5  	  RRR4       TP%                  4        F(  w  rÞYé9   g   K  T P                   P                  T4       K*  	  R# u upi   + '       g   i     EL ; i  \         d*   pT P                  P                  RT 24        Rp?ELRRp?ii ; i  + '       g   i     Lž; i  \         d)   pT P                  P                  RT 24        Rp?LÏRp?ii ; i)zhObtain a list of loaded kernel modules to reference later for plugin
enablement and SoSPredicate checks
Úlsmod)Útimeoutr   r@   z/usr/lib/modules/z/modules.builtinrO   rP   rQ   r   z.koNz Unable to read kernel builtins: ÚdevlinkÚCONFIG_NET_DEVLINKÚdm_modÚCONFIG_BLK_DEV_DMz/boot/config-z/lib/modules/z/configz#Unable to find booted kernel configz=yz%Unable to read booted kernel config: éÿÿÿÿ)Úkernel_modsr#   Úunamer`   r   r   rE   ÚextendrG   rH   Újoin_sysrootrW   rD   ÚIOErrorÚsoslogÚwarningr$   ÚexistsrŽ   )r-   r`   ÚlinesrK   ÚbuiltinsÚmfileÚkmodÚerrÚconfig_stringsÚkconfigsÚkconfigÚbooted_configÚkfileÚbuiltinr˜   s   &              r3   r!   ÚLinuxPolicy.init_kernel_modulesè   sp  € ð ˆÔÜ—(’(“*×$Ñ$ˆô ˜'¨1°T·\±\ÔB×MÑMÓOˆØ×Ñ×ÑØ05°b¶	ó!
Ù09¨�J‰J‹L˜�O×!Ñ!Ö#±	ñ!
ô 	ð
 ×$Ñ$Ø ˜yÐ(8Ð9ó
ˆð	JÜ�h ¨g×6Õ6¸%Û!�DØŸ:™: c›?¨2Õ.×4Ñ4°UÓ;¸AÕ>�DØ×$Ñ$×+Ñ+¨DÖ1ñ "÷ 7ð Ð+ØÐ)ð
ˆð ˜G˜9Ð%Ø˜G˜9 GÐ,ð
ˆó  ˆGØ×'Ñ'¨Ó0ˆGÜ�w‰w�~‰~˜g×&Ô&Ø '�Ùñ	  ð �K‰K×ÑÐ EÔFÙàˆð	OÜ�m S°7×;Õ;¸uÛ!�DØ˜t–|Ø Ÿ™¨¯
©
°4Ó(8¸Õ(;Ö<ñ "÷ <ð -×2Ñ2Ö4‰NˆGØÖ Ø× Ñ ×'Ñ'¨Ö0ó 5ùò]!
÷ 7×6Ð6ûô ô 	JØ�K‰K×ÑÐ"BÀ3À%Ð H×IÒIûð	Jú÷4 <×;ûô ô 	OØ�K‰K×ÑÐ"GÈÀuÐ M×NÑNûð	Oúsy   Á--H2Â7I ÃAH7Ä I ÆJ Æ2
JÇ+JÇ,J È7I	ÉI ÉI ÉI?ÉI:É:I?ÊJ	ÊJ ÊJ ÊKÊ KËKc                ó¾   € V P                   '       dK   V P                   R 8w  d:   \        P                  P                  V P                   VP	                  R 4      4      pV# )r   )r   r#   r$   r�   Úlstrip)r-   r$   s   &&r3   r°   ÚLinuxPolicy.join_sysroot#  s<   € Ø�<�<ˆ<˜DŸL™L¨CÔ/Ü—7‘7—<‘< §¡¨d¯k©k¸#Ó.>Ó?ˆDØˆr5   c                óœ   € V P                   R ,          pVP                  '       d   V P                  4        V P                  V4      V n        R# )ÚcmdlineoptsN)ÚcommonsÚlow_priorityÚ_configure_low_priorityÚprompt_for_case_idÚcase_id©r-   Úcmdline_optss   & r3   Úpre_workÚLinuxPolicy.pre_work(  s>   € ð —|‘| MÕ2ˆà×$×$Ð$Ø×(Ñ(Ô*ð ×.Ñ.¨|Ó<ˆŽr5   c                ó  € VP                   '       g>   VP                  '       g,   VP                  '       g   \        \	        R 4      4      Vn        VP                  '       d   VP                  MRV n        V P                  # )zNOptionally, please enter the case id that you are generating this report for: r   )ÚbatchÚquietrÊ   ÚinputÚ_rË   s   &&r3   rÉ   ÚLinuxPolicy.prompt_for_case_id3  so   € Ø×!×!Ð!Ø×"×"Ð"Ø×'×'Ð'Ü',Üð 5ó 6ó(�Ô$ð
 × × Ð ð $×+Ò+Ø&(ð 	Œð �|‰|Ðr5   c                ó4  € \         P                  ! 4       p\        R4      '       dn   \        RV 2^R7      pVR,          ^ 8X  d   V P                  P                  R4       MNRVR,           RVR,           R	2pV P                  P                  V4       MV P                  P                  R
4        \         P                  ! ^4       V P                  P                  R4       R#   \         d*   pT P                  P                  RT 24        Rp?R# Rp?ii ; i)aQ  Used to constrain sos to a 'low priority' execution, potentially
letting individual policies set their own definition of what that is.

By default, this will attempt to assign sos to an idle io class via
ionice if available. We will also renice our own pid to 19 in order to
not cause competition with other host processes for CPU time.
Úionicezionice -c3 -p )r§   ÚstatuszSet IO class to idlez Error setting IO class to idle: Úoutputz (exit code Ú)zNWarning: unable to constrain report to idle IO class: ionice is not available.zSet niceness of report to 19z%Error setting report niceness to 19: N)r#   Úgetpidr   r   r²   ÚinfoÚerrorÚui_logr³   ÚniceÚ	Exception)r-   Ú_pidÚretÚmsgr¹   s   &    r3   rÈ   Ú#LinuxPolicy._configure_low_priority@  sð   € ô �yŠy‹{ˆÜ˜×"Ò"Ü(Ø   Ð'°ôˆCð �8�} Ô!Ø—‘× Ñ Ð!7Õ8à9¸#¸h½-¸ð I%Ø%(¨¥] O°1ð6�à—‘×!Ñ! #Õ&à�K‰K×Ñð+ôð
	MÜ�GŠG�BŒKØ�K‰K×ÑÐ;Ö<øÜô 	MØ�K‰K×ÑÐ EÀcÀUÐK×LÒLûð	Mús   Â01C# Ã#DÃ.DÄDc                ó   € R# )zÚIf sos report commands need to always be prefixed with something,
for example running in a specific container image, then it should be
defined here.

If no prefix should be set, return an empty string instead of None.
r   r7   ra   s   &r3   Úset_sos_prefixÚLinuxPolicy.set_sos_prefix_  s   € ñ r5   c                ó   € R# )zSIf a host requires additional cleanup, the command should be set and
returned here
r   r7   ra   s   &r3   Úset_cleanup_cmdÚLinuxPolicy.set_cleanup_cmdh  s   € ñ r5   c                ó   € R# )aÙ  Returns the command that will create the container that will be
used for running commands inside a container on hosts that require it.

This will use the container runtime defined for the host type to
launch a container. From there, we use the defined runtime to exec into
the container's namespace.

:param image:   The name of the image if not using the policy default
:type image:    ``str`` or ``None``

:param auth:    The auth string required by the runtime to pull an
                image from the registry
:type auth:     ``str`` or ``None``

:param force_pull:  Should the runtime forcibly pull the image
:type force_pull:   ``bool``

:returns:   The command to execute to launch the temp container
:rtype:     ``str``
r   r7   )r-   ÚimageÚauthÚ
force_pulls   &&&&r3   Úcreate_sos_containerÚ LinuxPolicy.create_sos_containero  s   € ñ* r5   c                ó8   € V P                    RV P                   2# )a  Restarts the container created for sos collect if it has stopped.

This is called immediately after create_sos_container() as the command
to create the container will exit and the container will stop. For
current container runtimes, subsequently starting the container will
default to opening a bash shell in the container to keep it running,
thus allowing us to exec into it again.
z start ©Úcontainer_runtimeÚsos_container_namera   s   &r3   Úrestart_sos_containerÚ!LinuxPolicy.restart_sos_container†  s#   € ð ×(Ñ(Ð)¨°×1HÑ1HÐ0IÐJÐJr5   c                óf   € V P                   '       d   V P                    RV P                   RV 2# V# )zïReturns the command that allows us to exec into the created
container for sos collect.

:param cmd: The command to run in the sos container
:type cmd: ``str``

:returns: The command to execute to run `cmd` in the container
:rtype: ``str``
z exec r†   rñ   )r-   Úcmds   &&r3   Úformat_container_commandÚ$LinuxPolicy.format_container_command’  s?   € ð ×!×!Ð!Ø×-Ñ-Ð.¨f°T×5LÑ5LÐ4MÈQØ�eðð àˆ
r5   )r    r£   rÊ   r"   r­   r&   r   )NNTN©r   )NNF)1Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__rˆ   ÚvendorrŠ   r.   rT   rB   rC   r‰   r)   Ú_preferred_hash_nameÚcontainerizedÚcontainer_imageÚsos_path_stripÚsos_pkg_nameÚsos_bin_pathró   Úcontainer_version_commandÚcontainer_authfiler   Úclassmethodr9   r\   rb   rg   rk   ro   rr   rw   r   rz   r|   r    r!   r°   rÍ   rÉ   rÈ   rå   rè   rî   rô   rø   Ú__static_attributes__Ú__classdictcell__Ú__classcell__)r2   Ú__classdict__s   @@r3   r   r   #   s/  ù‡ € ñ-à€FØ*€DØ€Dð €OØ€OØ€MØ€KØ (ÐØÐà€MØ€OØ€NØ€LØ€LØ,ÐØ $ÐØÐ÷'AðR ñ
ó ð
ð ó,ó ð,ò8òòòò ò4ð ñ-ó ð-ð ñ
ó ð
ð ñ(ó ð(òTò"91òvò
	=òòMò>òôò.
K÷ò r5   r   c                   óF   a € ] tR tRt o RtR.tRtRt]R	R l4       t	Rt
V tR# )
ÚGenericLinuxPolicyi£  z„This Policy will be returned if no other policy can be loaded. This
should allow for IndependentPlugins to be executed on any systemÚSoSa  SoS was unable to determine that the distribution of this system is supported, and has loaded a generic configuration. This may not provide desired behavior, and users are encouraged to request a new distribution-specifc policy at the GitHub project above.
c                ó   € \         h)r<   )ÚNotImplementedError)r8   rZ   s   &&r3   r\   ÚGenericLinuxPolicy.check¯  s
   € ô "Ð!r5   r7   N)zUpstream Projectz https://github.com/sosreport/sosrú   )rû   rü   rý   rþ   rˆ   rŒ   rÿ   Úvendor_textr  r\   r	  r
  )r  s   @r3   r  r  £  s6   ø‡ € ñHð LÐL€KØ€Fð<€Kð ó"ó ö"r5   r  )r#   ru   Úsosr   rÓ   Úsos.policiesr   Úsos.policies.init_systemsr   Ú!sos.policies.init_systems.systemdr   Úsos.policies.runtimes.crior   Úsos.policies.runtimes.podmanr   Úsos.policies.runtimes.dockerr	   Úsos.policies.runtimes.lxdr
   Úsos.utilitiesr   r   r   r   rX   rž   r¡   r   r  r7   r5   r3   Ú<module>r     s\   ðó 
Û 	å Ý Ý 0Ý 9Ý ;Ý ?Ý ?Ý 9÷3ó 3ð €
à€ØÐ ô}�&ô }ô@"˜ö "r5   