MauroRC
Posts: 4
Joined: Tue Oct 27, 2015 1:26 am

ERROR RUNNING PROGRAM TO AUTOMATICALLY START

Fri Nov 27, 2015 1:22 am

Hello people.

I have a program in Python and I want to run automatically when you start the Raspberry Pi. I found an online code to do that, but I throw error, the error that throws me is the following:

insserv: warning: script 'K01Color' missing LSB tags and overrides
insserv: warning: script 'Color' missing LSB tags and overrides

The code I'm using is as follows:

#! / bin / sh
# /etc/init.d/Color

case "$ 1" in
         start)
           echo "Starting"
           / usr / bin / python /home/pi/Arduino.py
           ;;
         stop)
           echo "Stopping program"
           ;;
         *)
           echo "Usage: /etc/init.d/Color {start | stop}"
           exit 1
           ;;
that C

exit 0
-------------------------END CODE--------------------------------------

¿Does anyone know how to fix this error?

User avatar
AndyD
Posts: 2334
Joined: Sat Jan 21, 2012 8:13 am
Location: Melbourne, Australia
Contact: Website

Re: ERROR RUNNING PROGRAM TO AUTOMATICALLY START

Fri Nov 27, 2015 1:41 am

If you have a look in /etc/init.d/ on you Raspberry Pi, there is a file called skeleton (less /etc/init.d/skeleton) that contains an example of a well formed init.d service. It is warning you that the LSB tags are missing. They look like this:-

Code: Select all

### BEGIN INIT INFO
# Provides:          skeleton
# Required-Start:    $remote_fs $syslog
# Required-Stop:     $remote_fs $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Example initscript
# Description:       This file should be used to construct scripts to be
#                    placed in /etc/init.d.
### END INIT INFO
and describe when the service should run.

If you are using Raspbian Jessie, I would suggest having a look at the systemd services. They are considerably easier to write.

Return to “Python”