Run my python script when start server frappe

I want use RabbitMQ to sync data beetween 2 server. So i want when bench start frappe, my script python is execute

Maybe you can make a custom app and use a hook with a cron job that runs every n seconds and checks if RabbitMQ is running and otherwise start it

Frappe Hooks

i want run it continuous to get messages from subscriber, not a cron job

Yeah the cron job is for starting RabbitMQ and running code when ERPNext is running which you asked in your question. You’ll have to implement the logic for the subscribers yourself when it is running

thank for your support