Score:0

podman load executed in systemd service not taking effect on fcos system

in flag

Hi I'm new to FedoraCoreOs. But I'm trying a very simple probe of concept. I'm trying to load a .tar docker image into the fedora core os local registry at starup. I'm using systemd and a service which will perform the load, but I'm missing something, since the service is executed, but when I type podman images the imaget listed.

This is my unit configuration

cat etc/systemd/system/test.service

    [Unit]

    Description=My custom service



    [Service]

    Environment=PODMAN_SYSTEMD_UNIT=%n

    Restart=on-failure

    Type=oneshot

    StandardInput=null

    StandardOutput=journal

    StandardError=journal+console

    RemainAfterExit=yes

    ExecStart=/etc/rc.d/init.d/startServiceTest.sh

The script being called is

cat /etc/rc.d/init.d/startServiceTest.sh

#!/usr/bin/env bash

podman load -i /etc/files/docker.tar

When the image boots I check the status of the service and it is run ok service status output

But after that if I check podman images the docker image is not listed. Note: If I run the commands manually it works

Any ideas??

Michael Hampton avatar
cz flag
It looks like they loaded correctly, but you really should not run podman as root.
starlord-wag avatar
in flag
juum. Do you know how can I execute this service as user?
Michael Hampton avatar
cz flag
Specify the user you want in the systemd unit.
starlord-wag avatar
in flag
Cool! Thanks for your help man
in flag
An alternative to using `User=` is to use systemd user services, where you place the configuration files inside the user's home directory under _~/.config/systemd/user_. I tried it out before https://github.com/Clinical-Genomics/scout/blob/master/containers/systemd/scout.fcc (The file can be converted to the Ignition file format with the tool [butane](https://github.com/coreos/butane)). To have the user service file start automatically you also need to create an empty file _/var/lib/systemd/linger/<username>_
Score:0
in flag

Since podman is rootless. I just added this lines to the [Service] section of the unit configuration.

User=<my target fcos machine user>
Group=<my target fcos machines group>
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.