Register for the iXsystems Community to get an ad-free experience and exclusive discounts in our eBay Store.

Autostart of TrueCommand when using Docker on Ubuntu

Patrick M. Hausen

Neophyte Sage
Joined
Nov 25, 2013
Messages
1,446
Hi all,

I installed TrueCommand on Ubuntu 18.04 with the docker.io package. The command line I use to create the running instance is this:
Code:
docker run -d --restart=always -v "/var/lib/truecommand:/data" -p 80:80 -p 443:443 --name=truecommand ixsystems/truecommand:1.2.2


When I reboot the VM the docker service is started, yet TrueCommand is not. As soon as I login via SSH and do docker ps TrueCommand will start.

Any ideas/hints? Should I take this to some platform with more Ubuntu/Docker savvy people or does someone here know what I did wrong?

Thanks,
Patrick
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
1,180
Usually, Docker takes some time to complete starting itself up after a reboot. In my VM, it's roughly 2 minutes after init completes before Docker becomes available. Do you have a "wait-for-docker" script or equivalent to see if Docker is actually completely up and running?
 

Patrick M. Hausen

Neophyte Sage
Joined
Nov 25, 2013
Messages
1,446
Nope. I monitor the VM from outside and TrueCommand on port 80 will simply not become ready for 20 minutes or more unless I log in and do that docker ps. Then it starts up instantly.
ps also does not show any of the relevant container processes before I enter that command.
 

Patrick M. Hausen

Neophyte Sage
Joined
Nov 25, 2013
Messages
1,446
Never mind - found it:
Code:
systemctl status docker
[...]
Loaded: loaded (/lib/systemd/system/docker.service; disabled; vendor preset: enabled)
[...]


So the general docker service was not enabled. After I changed that, TrueCommand starts at boot, too: systemctl enable docker

Kind regards,
Patrick
 

Basil Hendroff

Neophyte Sage
Joined
Jan 4, 2014
Messages
1,044
@Patrick M. Hausen Best not to specify the version otherwise you may be locked into an earlier release.

Code:
docker run -d --restart=always -v "/var/lib/truecommand:/data" -p 80:80 -p 443:443 --name=truecommand ixsystems/truecommand

If you're on the previous version, easiest at this stage to remove the container and image and redo the above command i.e.

Code:
sudo docker rm -f truecommand
sudo docker system prune -a
 
Top