BigSur: systemsetup throws an error, but executes anyway

I run some scripts to set up certain things when building a computer. Recently (ala Big Sur+) the specific commands to set things using systemsetup throw an error. It worked perfectly in the past, so something has changed, in fact I seem to recall it worked in earlier versions of BigSur.


This is the error:

2022-04-09 07:07:33.282 systemsetup[2738:43831] ### Error:2 File:/System/Volumes/Data/SWE/macOS/BuildRoots/9dc5c14c79/Library/Caches/com.apple.xbs/Sources/Admin/Admin-876.2/InternetServices.m Line:379


Here is a code example:


#!/usr/bin/perl
$TZ = "America/New_York";
$CMD="sudo /usr/sbin/systemsetup ";
print "set timezone\n\n";
`$CMD -settimezone Pacific/Wake`;
$curTZ = `$CMD -gettimezone`;
print "\n\n$curTZ\n\n";
`$CMD -settimezone $TZ`;
$curTZ = `$CMD -gettimezone`;
print "\n\n$curTZ\n\n";


Notes:

  1. even though it throws the error, it still sets the timezone correctly.
  2. the error is the same no matter what "-set" verb is used; timezone, timeserver, computersleep, etc.


Any thoughts?

Thanks.

Paul

Posted on Apr 8, 2022 12:47 PM

Reply

Similar questions

There are no 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.

BigSur: systemsetup throws an error, but executes anyway

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