관리-도구
편집 파일: 160_unmount_sigs_v1.cpython-311.pyc
� IMg� � �V � d Z ddlZddlZddlmZ ej e� � Zdd�Zdd�Z dS )zUnmount sigs/v1 from CageFS.� N)�PathFc � � |rd S ddl m} |j }n# t $ r d}Y nw xY w t |� � � � � }d|vrd S n@# t $ r Y d S t $ r'}t � d||� � Y d }~d S d }~ww xY w t j d|�d�dd � � � d S # t $ r&}t � d|� � Y d }~d S d }~ww xY w)Nr )�clcagefsz/etc/cagefs/cagefs.mpz/var/imunify360/files/sigs/v1zCan't read %s, reason: %sz5sed -i.im360-bak '\:/var/imunify360/files/sigs/v1:d' z� && grep /var/imunify360/files/sigs/v1 /proc/mounts | awk '{ print $2 }' | xargs -rn1 umount && /usr/sbin/cagefsctl --wait-lock --unmount-all && /usr/sbin/cagefsctl --wait-lock --force-update-etc && /usr/sbin/cagefsctl --wait-lock --remount-allTz /bin/bash)�shell� executablez!Can't unmount sigs/v1, reason: %s)�im360.subsysr �CAGEFS_MP_FILENAME�ImportErrorr � read_text�FileNotFoundError� Exception�logger� exception� subprocess� check_call)�migrator�database�fake�kwargsr �filename�text�es �c/opt/imunify360/venv/lib/python3.11/site-packages/defence360agent/migrations/160_unmount_sigs_v1.py�migrater s{ � �� ���+�)�)�)�)�)�)��.����� +� +� +�*����+���� ��H�~�~�'�'�)�)�� +�$�6�6��F� 7�� � � � ����� � � ����4�h��B�B�B���������������A���� DL�8�8� N� �"� � � � � � �� � A� A� A����<�a�@�@�@�@�@�@�@�@�@�����A���sA � �#�#�!A � B� B�%B�B�B- �- C�7C�Cc � � d S )N� )r r r r s r �rollbackr . s � ��D� )F) �__doc__�loggingr �pathlibr � getLogger�__name__r r r r r r �<module>r$ s{ �� "� "� ���� � � � � � � � � � � �� �8� $� $��"A� "A� "A� "A�J � � � � � r