my question similar to: How to write an init script that will execute an existing start script?
However, that question is outdated and I like to know how I can do that in Ubuntu 20.04
This my try in init.d directory:
#! /bin/sh
### BEGIN INIT INFO
# Provides: myrec
# Required-Start: $all
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop:
# Short-Description: your description here
### END INIT INFO
PATH=/home/ahmad/recordings
DESC="Recording audio output"
NAME=myrec
DAEMON=/home/ahmad/recordings/myrec.sh
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME
I would like to run it after all processes executed, so should I use a systemd service or the above is okay?
Should I add other code to above or it runs my sh (
myrec.sh
) file?
In general What is a hello world
for executing a simple bash (so that I can see the result) for ubuntu 20.04? Every thing I found in the web is outdated