launching a custom process with launchd is wiping out other application files

I built a custom binary which requires elevated privileges to execute. I wrote a launchd plist file and loaded it. On loading , the app is working as expected but lot of apps were corrupted. Apps like chrome, slack, zoom etc became un openable . Even my mouse right click stopped working. When I looked at the contents of the chrome in application directory it was missing few files.

contents of chrome before launching my custom app

-rw-r--r--@  1 myusername  admin   2556 May 14 16:49 CodeResources
drwxr-xr-x@  3 myusername  admin     96 May 14 15:59 Frameworks
-rw-r--r--@  1 myusername  admin  11851 May 14 16:17 Info.plist
drwxr-xr-x@  3 myusername  admin     96 May 14 15:59 Library
drwxr-xr-x@  3 myusername  admin     96 May 14 16:17 MacOS
-rw-r--r--@  1 myusername  admin      8 May 14 15:59 PkgInfo
drwxr-xr-x@ 61 myusername  admin   1952 May 14 15:59 Resources
drwxr-xr-x@  3 myusername  admin     96 May 14 16:17 _CodeSignature
-rw-r--r--@  1 myusername  admin  12551 May 14 15:59 embedded.provisionprofile

contents of chrome after launching my custom app

drwxr-xr-x@  3 myusername  admin    96 May 14 15:59 Frameworks
drwxr-xr-x@  3 myusername  admin    96 May 14 15:59 Library
drwxr-xr-x@  2 myusername  admin    64 May 16 13:48 MacOS
drwxr-xr-x@ 58 myusername  admin  1856 May 16 13:48 Resources
drwxr-xr-x@  2 myusername  admin    64 May 16 13:48 _CodeSignature

my custom app plist file

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
    <dict>
        <key>Label</key>
        <string>com.zzzz.xxxx</string>
        <key>Program</key>
        <string>/path/to/app</string>
        <key>RunAtLoad</key>
        <true/>
    </dict>
</plist>

If i run my custom app as a standalone process everything works as expected, no corruption or data loss.

To restore the apps, I reinstalled them. But cant figure out why this is happening. Also not sure how to make secondary click work again. I tried with multiple mouses , same issue.

Any help on this is appreciated.

Nvm found the issue, not related to launchd. Some bad code within the app.

launching a custom process with launchd is wiping out other application files
 
 
Q