Thanks for the feedback. Unfortunately, my iMac is an older Mac:
Model Name: iMac Model Identifier: iMac11,3 Processor Name: Intel Core i7 Processor Speed: 2.93 GHz Number of Processors: 1 Total Number of Cores: 4 L2 Cache (per Core): 256 KB L3 Cache: 8 MB Memory: 32 GB Boot ROM Version: 99.0.0.0.0 SMC Version (system): 1.59f2
I don’t think it supports the Docker Desktop app because I tried to install and it won’t run on my Mac. I have a LINUX server that I am starting to use UBUNTU on. I mostly want to
use the iMac because I develop there mostly. I want to add a start and stop feature to an Admin Panel that I have through the API. The start stop just communicates with the system
that Orthanc is running on, not with Orthanc through the REST API>
`
Incompatible CPU detected
We are sorry, but your hardware is incompatible with Docker Desktop.
Docker requires a processor with virtualization capabilities and hypervisor support.
To learn more about this issue see:
https://docs.docker.com/docker-for-mac/troubleshoot
`
There is a way to install docker using the CLI and something like homebrew: e.g. https://medium.com/@yutafujii_59175/a-complete-one-by-one-guide-to-install-docker-on-your-mac-os-using-homebrew-e818eb4cfc3
That is kind of a pain, and not sure it would work anyways since my Mac can’t run anything higher than High Sierra. Might have to consider buying an more recent refurbished iMac if I want to use Docker on the Mac.
This link is helpful: https://alvinalexander.com/mac-os-x/launchd-examples-launchd-plist-file-examples-mac/
Sample .plist:
<?xml version="1.0" encoding="UTF-8"?>
http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>label</key>
<string>com.devdaily.pingwebsites</string>
<key>ProgramArguments</key>
<array>
<string>/Users/al/bin/crontab-test.sh</string>
</array>
<key>OnDemand</key>
<false/>
<key>Nice</key>
<integer>1</integer>
<key>StartInterval</key>
<integer>60</integer>
<key>StandardErrorPath</key>
<string>/tmp/AlTest1.err</string>
<key>StandardOutPath</key>
<string>/tmp/AlTest1.out</string>
</dict>
</plist>
Is it possible to pass some args to the shell script or otherwise write separate start, stop and restart scripts for Orthanc ?
The example in the initial post seems to work for starting up using the terminal, but to stop Orthanc I have to hit Ctrl-C in the terminal
because it is running in the foreground.
I presume that if I use the launchd it would start up in the background , but I'm not sure how to stop Orthanc when it is started up using a launchd.
The Unix Debian script has this:
do_start()
{
# Prepare a directory to store the Orthanc logs
mkdir -p $LOGDIR
chown $ORTHANC_USER $LOGDIR
# Return
# 0 if daemon has been started
# 1 if daemon was already running
# 2 if daemon could not be started
start-stop-daemon --start --quiet --pidfile $PIDFILE --chuid $ORTHANC_USER --background --exec $DAEMON --test > /dev/null \
>> return 1
start-stop-daemon --start --quiet --make-pidfile --pidfile $PIDFILE --chuid $ORTHANC_USER --background --exec $DAEMON -- $DAEMON_ARGS \
>> return 2
# Add code here, if necessary, that waits for the process to be ready
# to handle requests from services started subsequently which depend
# on this one. As a last resort, sleep for some time.
}