Once fossil is set up, I wanted it to start automatically on system reboot, so that I needn’t worry about it in the future.
After trying many different ways of doing this and failing, I ended up with a configuration which included a shell script and supervisor to start it.
The shell script
This is a simple one-liner, which ran fossil as scgi
#!/bin/sh fossil server --nojail --repolist --localhost \ --port <port number> --scgi <directory of REPOs> > /dev/null
For supervisor, I followed this DigitalOcean tutorial.
After the usual installation steps which meant –
apt-get install supervisor
I set up the supervisor program under
[program:fossil] command=<path to fossil server script from step 1> autostart=true autorestart=true stderr_logfile=/var/log/fossil.err.log stdout_logfile=/var/log/fossil.out.log
And that’s it. Now Nginx is set to point to Fossil which is running on a predefined port via a shell script which will run automatically on system boot.
All set now for whatever else comes ahead!