N|jo h d Z ddlZddlZddlmZ ej e Z G d de Z d Z dS )z"Notify systemd about process state N)ANTIVIRUS_MODEc " e Zd ZdZdZdZdZdZdS ) AgentStatez*Allowed agent state for notifying systemd.zREADY=1zSTATUS=Starting main processz#STATUS=Applying database migrationszSTATUS=DemonizedN)__name__ __module____qualname____doc__READYSTARTING MIGRATING DAEMONIZED \/opt/imunify360/venv/lib/python3.11/site-packages/defence360agent/subsys/systemd_notifier.pyr r s( 44E-H5I#JJJr r c t rdS ddl}dt j vrt d dS | d }| | dS # t $ r&}t d| Y d}~dS d}~ww xY w# t $ r&}t d| Y d}~dS d}~ww xY w) z Send notification to systemd, allowed formats described here https://www.freedesktop.org/software/systemd/man/sd_notify.html For example: notify("STATUS=Almost ready") Nr NOTIFY_SOCKETz$NOTIFY_SOCKET environment variable is not set. It is set by service manager for supervised processes for status and start-up completion notification. Nowhere to send the status.T)debugz9some problem has occurred during notifying of systemd: %sz!Can't import sdnotify, reason: %s)r sdnotifyosenvironloggerwarningSystemdNotifiernotify Exception exceptionImportErrorinfo)stater nes r r r s& "*,,NN ,,4,88 # <