4

In ubuntu we do simple:

service MyService restart
service MyService stop
...

So, the service command is good and simple. I need this simplicity: how to install service command on Debian?

PS: this is an analog question, but here I need a command, not an explanation.

  • in debian10, service is not available if you login with su, but if you login with su - or sudo su it will be available.. something about $PATH environment variable not being set correctly if only logging in with su – hanshenrik May 29 '19 at 20:51

1 Answers1

19

The service command is part of the sysvinit-utils package.

Install it with:

apt-get install sysvinit-utils

But most probably, it is already installed in /usr/sbin/service.

If it's missing in your $PATH, add this line to your ~/.bashrc:

PATH=$PATH:/usr/sbin
chaos
  • 48,171