Hi kuldeep Singh,
It seems that whenever your web app is restarted, the Unison-FSMonitor is starting automatically. This is because this process is being triggered by the service, script or default startup behavior of the environment. Since the Pkill command only eliminates the process on the runtime, it does not prevent re -launch after the restart.
To disable permanently unison-FSMONITOR from re-starting, you need to modify the startup configuration of your Azure App service.
Instead of running only Pkill -F Unison -FSmonitor, you should add a continuous mechanism to stop it. Update your startup command to include the following:
#!/bin/bash
pkill -f unison-fsmonitor
while true; do pkill -f unison-fsmonitor; sleep 10; done &
steps to update the startup command in Azure go to azure portal, Open your app service ->Click on the configuration (from the left panel)->Scroll down for a startup command,Enter the script above and save
if you installed as service remove unison-fsmonitor from Auto-Startup,If the issue persists, it might be that unison-fsmonitor is registered as a service. You can check and disable it using SSH/Kudu:
systemctl disable unison-fsmonitor
systemctl stop unison-fsmonitor
make sure you restart the web apps
Use SSH/Kudu to confirm the process is no longer running:
ps aux | grep unison
If nothing appears, it’s successfully removed.
https://learn.microsoft.com/en-us/azure/app-service/configure-custom-container?pivots=container-linux&tabs=debian#custom-startup-command
https://learn.microsoft.com/en-us/azure/app-service/configure-linux-open-ssh-session?pivots=container-linux
If the answer is helpful, please click Accept Answer and kindly upvote it so that other people who faces similar issue may get benefitted from it.
Let me know if you have any further Queries.