Why is the service command ... restart does not work and running systemctl restart ...?

Faced with the fact that the team, for example,
service postfix restart
not working. issued: bash: service: command not found
and when run the command
systemctl restart postfix, then everything is OK.
also works
/etc/init.d/postfix restart

But in the instructions it is given the first command. And you can explain to me what's the difference?
April 4th 20 at 00:30
2 answers
April 4th 20 at 00:32
this is a wrapper to start and check the status of demons

service works with files in /etc/init.d and was used together with the old init system.
systemctl works with files in /lib/systemd

the final team can be there and there and there and there ))

systemctl a more modern/better, but by and large it doesn't matter
thank you! how to become a prof how are you ? - Stella.Au commented on April 4th 20 at 00:35
service works with files in /etc/init.d and was used together with the old init system.

Can there ever was, I do not know, do not want in a long history of digging.

But now man service
service runs a System V init script or systemd unit in as predictable
an environment as possible, removing most environment variables and
with the current working directory set to /.

service wrapper and not part of sysv. Can work with sysv, can pull the same systemctl
Is part of the package init-system-helpers. While the package is essential - that is, to remove it we must try. - moses commented on April 4th 20 at 00:38
@Urban_Parker66, play "who wants to be a millionaire" and clearly use the tips:

1) call a friend - ask guru (the guru must be found, usually it is the elders at work)
2) using the room - toaster / forums, too, need to find a forum with some question, as a rule, aspartic few photographers live on microstock ru, and Finance - banks ru
3) 50 50 - to think for himself, discarding the obviously wrong options - it is also not so difficult if you build a chain of events - hillard.Little commented on April 4th 20 at 00:41
@ahmed, use the first two paragraphs )) - Stella.Au commented on April 4th 20 at 00:44
April 4th 20 at 00:34
$ apt-file search /usr/sbin/service
init-system-helpers: /usr/sbin/service

If the package "init-system-helpers" is not necessary, or "/usr/sbin/" not in PATH, it will be a mistake.
In Debian "/sbin" and "/usr/sbin" is not in PATH environment regular user, but the software out without a full path can be called via sudo.
Compare the output of env and sudo env.

For details, go to /etc/profile and /etc/sudoers.

Find more questions by tags Debian