Systemd complaints of missing file “No such file or directory” inspite of file being present

The contents of my service file srvtemplate-data-i4-s1.conf is


[Unit]Description=test service for usersAfter=network.target local-fs.target[Service]Type=forkingRemainAfterExit=noPIDFile=/data/i4/srvt.pidLimitCORE=infinityEnvironmentFile=%I...[Install]WantedBy=multi-user.target

I am starting my service as follows passing it an environment file but it fails with error as below.


# systemctl  start srvtemplate-data-i4-s1.conf@-data-i4-env.service
Failed to start srvtemplate-data-i4-s1.conf@-data-i4-s1-env.service: Unit srvtemplate-data-i4-s1.conf@-data-i4-env.service failed to load: No such file or directory.

The files are actually present


# ls -lrt /usr/lib/systemd/system/srvt*
-rw-r--r-- 1 root root 815 Dec 13 07:31 /usr/lib/systemd/system/srvtemplate-data-i4-s1.conf@.service

# ls /data/i4/env 
/data/i4/env

# cat /data/i4/env 
SRV_CONF="/data/i4/s1.conf"

But systemd not able to find the files.

When I do systemd reload and then fire the ablove start command it works fine.


systemctl daemon-reload

But still why is systemd not able to find the files and what can I do so that start command succeeds without firing the reload command?

It seems you added the CODE tags afterwards. That is not really working. As you can see the layout (particularly of the first item above) is already broken then.

Copy/paste directly from the terminal window in between the CODE tags. Do not forget to make your copy sweep big enough to let it contain also both prompts and the command. Now we have to assume you did a cat for the first item, but we can not be sure. And adding colouring is also not needed. Every sign that you altered things, makes all other info we see there suspicious.

So, next time better :wink:

You may have to ‘systemctl enable your_service_here’ first.