The miniconda path in your script makes me think you’re running on an embedded Linux system such as a rpi.
I have had success running in a similar setup using systemd. It should work on any Linux distribution that supports systemd.
It is fairly straightforward to set up on a Linux-based device that supports systemd.
Create a file that defines the service and copy that file to /lib/systemd/system
sudo cp my-app.service /lib/systemd/system/.
Start the service
sudo systemctl start my-app
Enable the service to run at boot
sudo systemctl enable my-app
The status of the service can be viewed with the following
service my-app status
Here’s an example of a service; the shell script referenced therein is a script that should execute that defines the functionality of the service. This should point to the bash script you’ve pasted into the topic; make sure that it has its execute attributes set, I believe.
my-app.service
[Unit]
Description=Bokeh web server service
After=network.target
StartLimitIntervalSec=0
[Service]
Type=simple
Restart=always
RestartSec=1
User=pi
ExecStart=/home/pi/dev/server/init/bk-web.sh
[Install]
WantedBy=multi-user.target
Thanks _jm,
I did create this app originally for RPi but as it developed the libraries pyproj associated with ARM were not available so I moved to Ubuntu x86-64.
Anyhow I did originally try systemd but the issue was still the script which won’t run the last line. So I guess my question should be How do you wrap the full bokeh serve command into a bash line?
I will try again based on your feedback and report back.
I see. I don’t see why it doesn’t work by inspection. The following is an example of a script I was running as a service on an embedded Linux platform and it behaved as expected.
I guess the only possible difference I see between your bash script and the one I used is that the path to bokeh is explicitly prescribed in my script. If the system running the script doesn’t know where to look for bokeh, that could cause the difference in behaviors we see.