0

I have been trying for while to run my script, it is called cservice and i placed it on /etc/init.d/ then i gave it the permission to be executable

sudo chmod +x /etc/init.d/cservice 

I can run it when i call it ./cservice and runs perfectly, this script is calling a php script #!/usr/bin/php /var/www/html/service.php it works when i run it manually but when i put it on start up with this command

then i put it on boot up

sudo update-rc.d cservice defaults 

and i get this warning

insserv: warning: script 'cservice' missing LSB tags and overrides 

then when i test it rebooting my server my apache server doesn't boot up and i have to do it manually what is happening this? However when i remove it my apache server boot up normally.

Need help please i am very new on ubuntu.

How can i make my script run without affecting my apache server.

3
  • I just searched for LSB tags in Google, and it showed many articles what you are missing. Please make a minimum effort of self research before posting questions over here. Commented Oct 5, 2016 at 3:51
  • 1
    I'm voting to close this question as off-topic because there was no minimum effort for self research Commented Oct 5, 2016 at 3:53
  • Please be aware that from Ubuntu 15 onwards it has switched to systemd and you should be creating service units rather than system V style init scripts (even though systemd does provide some backward compatibility for those) wiki.ubuntu.com/SystemdForUpstartUsers Commented Oct 5, 2016 at 4:31

1 Answer 1

1

I fixed this by putting this after my script:

### BEGIN INIT INFO # Provides: cservice # Required-Start: $local_fs $network # Required-Stop: $local_fs # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: cservice # Description: cservice server daemon ### END INIT INFO 

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.