You need a shell script to stop / start / restart the service and indicate its status. They are usually called rc scripts. Look in the /etc/init.d directory to see some examples - / etc / init.d / klogd is pretty simple.
The reason they are in init.d is because they must also start automatically at boot in order to restore the service.
Each version of Linux tends to be slightly different from how the boot works, but the Debian system is pretty typical as it is the basis for many other distributions - see Debian Download Manager
Dipstick
source share