gdraheim / docker-systemctl-replacement

docker systemctl replacement - allows to deploy to systemd-controlled containers without starting an actual systemd daemon (e.g. centos7, ubuntu16)
European Union Public License 1.2
1.4k stars 401 forks source link

status command shows unit files ignored by SystemD #172

Closed pakutoma closed 9 months ago

pakutoma commented 11 months ago

Hello. It seems that systemctl3.py shows unit files that are ignored by SystemD in the status command.

Input command

$ echo -e "[Unit]\nDescription=Test service" > /etc/systemd/system/test
$ systemctl status test

Expect (systemd 219)

Unit test.service could not be found.

Actual (systemctl3.py in master)

test - Test service
    Loaded: loaded (/etc/systemd/system/test, static)
    Active: unknown (dead)

The reason for this is that match_sysd_units accepts files without suffixes. More details are in the following PR. https://github.com/gdraheim/docker-systemctl-replacement/pull/171

If this is indeed a bug and you are willing to let me fix it, I will also fix the Python 2 version. Or if you want to fix it yourself, that is still totally fine.

Thank you for the good product!

gdraheim commented 9 months ago

Well, I did intend to allow any new type of unit to be matched as well. But let's make a quick fix here that SystemD files must have an extension - in contrast to SysV files.

pakutoma commented 9 months ago

Thank you so much!