Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Incomplete LSB comment. insserv: missing valid name for `Provides:' please add

Tags:

linux

init

debian

Recently I installed: Debian x86_64, oracle 11g and OCI8. I'd like to turn automatic the shell script below, but I received the following message error:

root@debian:/etc/init.d# uname -a
Linux debian 3.2.0-4-amd64 #1 SMP Debian 3.2.54-2 x86_64 GNU/Linux

root@debian:/etc/init.d# update-rc.d oracle-shm defaults
update-rc.d: using dependency based boot sequencing
insserv: Script oracle-shm is broken: incomplete LSB comment.
insserv: missing valid name for `Provides:' please add.

Looking my configuration file it has the comment necessary, as you can see below.

#! /bin/sh
case "$1" in
start)
  echo "Starting script /etc/init.d/oracle-shm"
  # Run only once at system startup
  rm -rf /dev/shm
  mkdir /dev/shm
  mount -t tmpfs shmfs -o size=2048m /dev/shm
  touch /dev/shm/.oracle-shm
  ;;
stop)
  echo "Stopping script /etc/init.d/oracle-shm"
  echo "Nothing to do"
  ;;
*)
  echo "Usage: /etc/init.d/oracle-shm {start|stop}"
  exit 1
  ;;
esac
#
### BEGIN INIT INFO
# Provides:          oracle-shm
# Required-Start:    $remote_fs $syslog
# Required-Stop:     $remote_fs $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Bind /run/shm to /dev/shm at system startup.
# Description:       Fix to allow Oracle 11g use AMM.
### END INIT

like image 702
Marcos Avatar asked Apr 02 '14 19:04

Marcos


1 Answers

I also received the message insserv: missing valid name for 'Provides:' please add ... when (re-)starting some init.d service foo. File /etc/init.d/foo did have a valid Provides line, i.e.:

...
# Provides:          foo
...

Nevertheless, service foo started fine despite that error message.

It turned out that insserv or whatever seems to complain about problems in any init.d script found in directory /etc/init.d/**, not necessarily the one that is currently being (re-)started.

Therefore, execute the following command to find problematic init.d scripts:

cd /etc/init.d/ && sudo grep -rin Provides

It will list all Provides lines of all scripts found in /etc/init.d/

Check whether all of them have a valid name provided.

In my case, there was a file /etc/init.d/template which had a Provides line without a name.

After I changed that file's line with Provides: template, the insserv error message disappeared.

like image 130
Abdull Avatar answered Nov 20 '22 19:11

Abdull