Permission denied error occurs on shell script after macos update to sonoma from ventura

I have developed a macos app.

in the app, launchd .plist file to run a shell script. (.plist file's location is /Library/LaunchAgents/)

In the script, I use below code to output log info.

Before update to sonoma , it worked well.

    local FileLogsTask="/var/log/my_task.log"
    echo ${Timestamp}:${Msg} >> "${FileLogsTask}"


After updated to sonoma.

  1. I found old my_task.log was lost
  2. After script is executed, my_task.log was not created
  3. 「/var/log/my_task.log: Permission denied」error is outputted


Has anyone encountered similar problems, know how to solve this problem?

MacBook Pro (M1, 2020)

Posted on Nov 2, 2023 7:22 PM

Reply

Similar questions

4 replies

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Permission denied error occurs on shell script after macos update to sonoma from ventura

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.