Lancache autostart on boot via service

Associate
Joined
10 Nov 2008
Posts
190
Location
Isle Of Wight, UK
Good day all.

I have quite a large family, and as such quite often we hit a problem with one of the children starting a game download / update, bringing the rest of the internet to a crawl and endless complaining form the rest of the children.

So to try and combat this I have build a small server running Ubuntu Server LTS and Lancache.

Lancache is all up and running and seems to be doing the job, but currently I have to SSH into it and start Lancache whenever we have a power outage, etc.

I tried to make a new "service" to start lancache, but it seems to start it and then quit again.

/etc/systemd/system/docker-compose-lancache.service
Code:
[Unit]
Description=Docker Compose LANCache Service
Requires=docker.service
After=docker.service

[Service]
Type=oneshot
RemainAfterExit=yes
WorkingDirectory=/home/lancache
ExecStart=/usr/bin/docker-compose up -d
ExecStop=/usr/bin/docker-compose down
TimeoutStartSec=0

[Install]
WantedBy=multi-user.target


Running "sudo service docker-compose-lancache status" returns the following;
docker-compose-lancache.service - Docker Compose LANCache Service
Loaded: loaded (/etc/systemd/system/docker-compose-lancache.service; enabled; vendor preset: enabled)
Active: active (exited)
Main PID: 2241 (code=exited, status=0/SUCCESS)
Tasks: 0 (limit: 4266)
Memory: 0B
CGroup: /system.slice/docker-compose-lancache.service

lancahce systemd[1]: Starting Docker Compose LANCache Service...
lancahce docker-compose[2241]: Creating network "lancache_default" with the default driver
lancahce docker-compose[2241]: Creating lancache_monolithic_1 ...
lancahce docker-compose[2241]: Creating lancache_dns_1 ...
lancahce docker-compose[2241]: [106B blob data]
lancahce systemd[1]: Finished Docker Compose LANCache Service.


Does anyone have any thoughts on what I have done wrong here?

Thanks in advance.
 
Last edited:
Back
Top Bottom