Problem with run_as_user on MacOS BigSur

I just started evaluating Nexus Repository Manager on a brand-new MacMini with ARM64 and got it to run just fine under the installer’s account. Then I tried to get it to work as a daemon by following the instructions about running it as a service. I finally got that to work but I had to modify both the nexus script and the plist file from their shipped/documented state.

To summarize:

  • Desired run-as account is “buildserver”
  • /Library/LaunchDaemons/com.sonatype.nexus.plist created as documented, owned by root:wheel, access 600
  • all files/folders in nexus install owned by “buildserver:staff”
  • bin/nexus modified with run_as_user=buildserver

To get it to work I changed the plist file to invoke with start-launchd rather than start. I also had to modify the run_unpack200 function in the script to check whether there were any .pack files before invoking the unpack loop or the script would fail.

I guess I am somewhat distrustful of what I did because I’m not the most skilled sysadmin. Is there a simpler way to get this working and did I shoot myself in the foot somewhere? If not, hopefully this helps someone else with the same problem.

Any feedback would be appreciated.