Getting "Service exited due to SIGTERM | sent by launchd" message for binary running as service under LaunchDaemons.Scenarios:I have a binary running as service(service plist contents pasted in at the end), everything works fine.Now in order to use the newly compiled binary, I unload the service, replace the existing binary with the new one and then load the service.I expect to see the service running but what I see is that the service was killed by launchd with SIGTERM. Not sure why???(snippet of system.log after doing launchctl load with the new binary)sh-3.2# launchctl load /Library/LaunchDaemons/com.MyPkg.myprogrambinary.plist
sh-3.2#
sh-3.2# tail /var/log/system.log
Nov 22 19:04:51 Nilesh-Mac-mini com.apple.xpc.launchd[1] (com.MyPkg.myprogrambinary): Unknown key for string: ServiceDescription
Nov 22 19:04:51 Nilesh-Mac-mini com.apple.xpc.launchd[1] (com.MyPkg.myprogrambinary): Please switch away from OnDemand to KeepAlive.
Nov 22 19:04:51 Nilesh-Mac-mini com.apple.xpc.launchd[1] (com.MyPkg.myprogrambinary[73878]): removing service since it exited with consistent failure - OS_REASON_EXEC
Nov 22 19:04:51 Nilesh-Mac-mini com.apple.xpc.launchd[1] (com.MyPkg.myprogrambinary): Service only ran for 0 seconds. Pushing respawn out by 10 seconds.
Nov 22 19:05:01 Nilesh-Mac-mini com.apple.xpc.launchd[1] (com.MyPkg.myprogrambinary[73886]): Service exited due to SIGTERM | sent by launchd[1]
Nov 22 19:05:01 Nilesh-Mac-mini com.apple.xpc.launchd[1] (com.MyPkg.myprogrambinary): Service only ran for 0 seconds. Pushing respawn out by 10 seconds.
Nov 22 19:05:11 Nilesh-Mac-mini com.apple.xpc.launchd[1] (com.MyPkg.myprogrambinary[73887]): removing service since it exited with consistent failure - OS_REASON_EXEC
Nov 22 19:05:11 Nilesh-Mac-mini com.apple.xpc.launchd[1] (com.MyPkg.myprogrambinary): Service only ran for 0 seconds. Pushing respawn out by 10 seconds.BTW, everything works fine with the newly replaced binary if I restart the system. Also, both the binaries and the .pkg are codesigned and notarized.Service plist:sh-3.2# ls -l /Library/LaunchDaemons/com.MyPkg.myprogrambinary.plist
-rwxr-xr-x 1 root wheel 1059 Nov 22 15:18 /Library/LaunchDaemons/com.MyPkg.myprogrambinary.plist
sh-3.2#
sh-3.2# cat /Library/LaunchDaemons/com.MyPkg.myprogrambinary.plist
Label
com.MyPkg.myprogrambinary
OnDemand
Program
/opt/myprogrambinary
ProgramArguments
/opt/config.json
RunAtLoad
ServiceDescription
MyPkg
UserName
root
WorkingDirectory
/opt/
sh-3.2#OS details:sh-3.2# system_profiler SPSoftwareDataType
Software:
System Software Overview:
System Version: macOS 10.15 (19A602)
Kernel Version: Darwin 19.0.0
Boot Volume: Macintosh HD
Boot Mode: Booted from installation CD/DVD
Computer Name: Nilesh-Mac-mini
User Name: System Administrator (root)
Secure Virtual Memory: Enabled
System Integrity Protection: Enabled
Time since boot: 4 days 4:01What is it that I am missing or doing wrong?PS: Observed that this is only reproducible on macOS 10.15 and not on any other macOS versions.Thanks in advance!!!Regards,Nilesh chate
Post
Replies
Boosts
Views
Activity
Hi,I am a software developer at https://www.continuum.net/ now https://www.connectwise.com/. We have a macOS package that was built 7-8 years back by some other organization. Now when I try to notarize this app by signing and recompile it, I few errors for 3rd party package "Growl.framework" and for a static library "libchilkatCocoa.a".1. Error "The binary uses an SDK older than the 10.9 SDK" for "Growl.framework".2. "The binary is not signed for "libchilkatCocoa.a".https://osxapps-ssl.itunes.apple.com/itunes-assets/Enigma113/v4/3a/62/b0/3a62b0e5-99d6-e0f4-a6ef-eaadf887f95c/developer_log.json?accessKey=1574270418_5198680920624751432_1EPanIVvmOtLsYnJzcGlsYn0kdh9GhFP0LtpAKvAqjp8kcRNPKH%2BKOniWK9r7kM79ZVH1muQm2hyeWbfJrj7hAT76CBB6i63Ha7%2BCLIDLOibeWnKO8IGdvYvoEatkFiTKHVlre0E9qTGKJrUpycPDfx8vSxHg3wJCZCkVmGaymU%3DCould you please help me understand how I can resolve these issues or if there is any workaround for this as I cannot recompile these as they are 3rd party framework.Thanks in advance!!!