Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have done a linux service using the article on this link http://shahmirj.com/blog/the-initd-script

After that I copied the files into the init.d directory

cp -f "myserviced" "/usr/sbin/myserviced"
cp -f "myservice" "/etc/init.d/myservice"
ln -s "/etc/init.d/myservice" "/etc/rc2.d/S99myservice"
ln -s "/etc/init.d/myservice" "/etc/rc0.d/K99myservice"

In the next step I started the service using the command Collapse | Copy Code

service myservice start

Then it prints like this myservice: unrecognized service

Why I am getting this error. I am using Ubuntu OS for installing my service. Not installed any chkconfig tool for installing services on linux. How I can solve this without installing any other tools.

share|improve this question

migrated from stackoverflow.com Jan 8 '13 at 19:48

This question came from our site for professional and enthusiast programmers.

    
I created my myserviced using C++ – Arun Kumar K S Dec 27 '12 at 12:29
    
Do you use sudo? – Karthik T Dec 27 '12 at 12:36
    
Also i believe the Init system is phased out in favour of upstart(or in the process of being phased out), not sure of details – Karthik T Dec 27 '12 at 12:37
    
yes I am using sudo – Arun Kumar K S Dec 27 '12 at 12:37
    
I cant find the option, but you would be better served taking up this question in Ubuntu or the unix stack exchanges, its rather off topic here. – Karthik T Dec 27 '12 at 12:39
up vote 1 down vote accepted

I solved the issue by using a skeleton script on Ubuntu OS

Debian and therefore Ubuntu, supplies a template that uses the Debian start-stop-daemon command to start and stop daemons. It is only necessary to copy this template to a new file of the correct name and modify it for the purpose.

sudo cp /etc/init.d/skeleton /etc/init.d/mydaemon

My Ubuntu service is working perfect now. Check this article for more details for any others who struggle to create a daemon on Ubuntu OS

http://www.andrewault.net/2010/05/27/creating-a-perl-daemon-in-ubuntu/

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .