Page 1 of 1

systemctl PATH with asterisk

Posted: 2020/06/30 11:04:19
by artur
Hi All,
I have several configuration files in /etc/systemd/system/
myservice_first.service
myservice_second.service
myservice_third.service
In centos 7 if I would like to see the status all of them at once I simply put:

systemctl status myservice*
(of course after "systemctl daemon-reload" command)

but in centos 8 this not working and I have to give the full name of service
systemctl status myservice_first
systemctl status yservice_second

why?
Regards,
Artur

Re: systemctl PATH with asterisk

Posted: 2020/06/30 11:13:36
by TrevorH
It works for me. For example, systemctl status u* shows me the status of 6 different services starting with u.

Re: systemctl PATH with asterisk

Posted: 2020/06/30 14:20:17
by artur
@TrevorH,
Yes, it is working for default services installed in the system. But no for the services defined by user-created files in /etc/systemd/system/
A.

Re: systemctl PATH with asterisk

Posted: 2020/06/30 14:25:35
by TrevorH
Are you sure your analysis is correct? You don't for example have files in your working directory that match the pattern you use that includes that *? If you use bash as your shell, it will helpfully expand e.g. "123*" to match any files that are present in the current working directory so if you have files called 1234 1235 in there, that will expand into `systemctl status 1234 1235` and that will only attempt to show the status for those two named services.

Re: systemctl PATH with asterisk

Posted: 2020/06/30 16:04:07
by artur
TrevorH,
Thank you, I don't know what was the cause. Maybe as you wrote I had a copy of the myservice.service file in my working directory. I am not sure. But the problem, in some magic way disappeared and now, the command: systemctl status m* gives what I expect.
Regards,
Artur