systemctl PATH with asterisk

Issues related to applications and software problems and general support
Post Reply
artur
Posts: 3
Joined: 2020/06/30 10:46:21

systemctl PATH with asterisk

Post by artur » 2020/06/30 11:04:19

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

User avatar
TrevorH
Forum Moderator
Posts: 28831
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: systemctl PATH with asterisk

Post by TrevorH » 2020/06/30 11:13:36

It works for me. For example, systemctl status u* shows me the status of 6 different services starting with u.
CentOS 6 will die in November 2020 - migrate sooner rather than later!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

artur
Posts: 3
Joined: 2020/06/30 10:46:21

Re: systemctl PATH with asterisk

Post by artur » 2020/06/30 14:20:17

@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.

User avatar
TrevorH
Forum Moderator
Posts: 28831
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: systemctl PATH with asterisk

Post by TrevorH » 2020/06/30 14:25:35

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.
CentOS 6 will die in November 2020 - migrate sooner rather than later!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

artur
Posts: 3
Joined: 2020/06/30 10:46:21

Re: systemctl PATH with asterisk

Post by artur » 2020/06/30 16:04:07

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

Post Reply

Return to “CentOS 8 - General Support”