Hi Christian,
Thanks for your reply.
a.lasterror is 0
a.readstream is empty
When I try from the command line there's no output either, so I'm not sure
readstream would have anything in it.
When I try /bin/launchctl print com.bodoni.server, it all works. a.lasterror is 0,
a.readstream has the same output as when I use a terminal. print can be used to see if a
launchdaemon is running.
So it looks like everything is working, but the service does not stop. We have to stop a
few services using this method. 1 is a consoleapp, 1 is an old API1 webserver app, 1 is a
newer API2 webserver app, so I don't think the style makes any difference.
If I stop the services from the terminal using the same command, running /bin/launchctl
load system/com.bodoni.server from AuthorizationMBS starts the service properly.
Regards,
Lee
On 7 Dec 2023, at 12:20, Christian Schmitz via MBS
Xojo Plugins <mbsxojoplugins(a)lists.monkeybreadsoftware.com> wrote:
Am 07.12.2023 um 12:07 schrieb Lee Badham via MBS
Xojo Plugins <mbsxojoplugins(a)lists.monkeybreadsoftware.com>om>:
Although there's no error shown, the service does not stop.
Could you maybe look like our example:
if a.LastError<>0 then
MsgBox "Lasterror on Execute: "+str(a.LastError)
else
e=a.Wait // wait for process to terminate. Returns PID
if a.LastError<>0 then
MsgBox "Lasterror on Wait: "+str(a.LastError)
end if
end if
msgbox a.ReadStream(1024)
So you would read the error message from the stream after it finished?
This is from the console log.
AuthorizationExecuteWithPrivileges and AuthorizationExecuteWithPrivilegesExternalForm are
deprecated and functionality will be removed soon - please update your application
Yes, Apple loves you to use helper apps for this.
See SMAppServiceMBS class.
Best regards,
Christian
--
Read our blog about news on our plugins:
http://www.mbsplugins.de/
_______________________________________________
MBS Xojo Plugins mailing list -- mbsxojoplugins(a)lists.monkeybreadsoftware.com
To unsubscribe send an email to mbsxojoplugins-leave(a)lists.monkeybreadsoftware.com