i’m trying to run LSIO containers using systemd under my user (using user lingering), but containers stops after a few seconds.
For example with Jackett, i have setup a unit file here: ~/.config/systemd/user/jackett.service
[Unit] Description=Jackett [Service] TimeoutStartSec=10min Restart=no ExecStop=-/usr/bin/docker stop %N ExecStartPre=-/usr/bin/docker rm %N ExecStartPre=/usr/bin/docker pull linuxserver/jackett ExecStartPre=/usr/bin/docker create --name %N -v %h/opt/appdata/jackett:/config -v /mnt/nas/media/Transit/blackhole/:/downloads -e PUID=%U -e PGID=1000 -v /etc/localtime:/etc/localtime:ro -p 9117:9117 linuxserver/jackett ExecStart=/usr/bin/docker start %N [Install] WantedBy=multi-user.target
When i run the service with systemd, the conainer is created, runs for a few seconds, and exit.
docker logs on the container yields the following:
[s6-init] making user provided files available at /var/run/s6/etc...exited 0. [s6-init] ensuring user provided files have correct perms...exited 0. [fix-attrs.d] applying ownership & permissions fixes... [fix-attrs.d] done. [cont-init.d] executing container initialization scripts... [cont-init.d] 10-adduser: executing... [cont-finish.d] executing container finish scripts... [cont-finish.d] done. [s6-finish] syncing disks. [s6-finish] sending all processes the TERM signal. [s6-finish] sending all processes the KILL signal and exiting.
Does anyone know why this is happening?
Is there maybe a guide on how to setup LSIO containers as systemd services?
I would like the containers to run at startup and restart on failure, so systemd seemed like a good option, but maybe there is another way (on Ubuntu) ?