[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: service vs systemctl



On Tue, 2023-03-07 at 15:38 +0800, Ken Young wrote:
> Hello
> 
> For debian 11, service is just a wrapper to systemctl, is it right?

It's a 217 line shell script and looking at it it checks for which init
system is in use. So if you have systemd (Debian's default now) then
yes, it will call systemctl.

> So for server management, both commands below have the same results.
> 
> sudo service nginx start
> sudo systemclt start nginx
> 

# Follow the principle of least surprise for SysV people:
# When running "service foo stop" and foo happens to be a service that
# has one or more .socket files, we also stop the .socket units.
# Users who need more control will use systemctl directly.

Personally, I still use 'service' through habit and won't change until
it doesn't do what I expect.

-- 
Tixy


Reply to: