1

In the CentOS, I can use :

systemctl restart xxx

to restart a service, and can use:

systemctl restart xxx.service 

to start a service too.

But if there is some difference here?

1 Answer 1

3

man systemctl:

Parameter Syntax Unit commands listed above take either a single unit name (designated as NAME), or multiple unit specifications (designated as PATTERN...). In the first case, the unit name with or without a suffix must be given. If the suffix is not specified (unit name is "abbreviated"), systemctl will append a suitable suffix, ".service" by default, and a type-specific suffix in case of commands which operate only on specific unit types. For example,

       # systemctl start sshd

and

       # systemctl start sshd.service

are equivalent, as are

       # systemctl isolate default

and

       # systemctl isolate default.target

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .