Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 02-07-2006, 06:45 PM   #1
Registered: Mar 2004
Location: Wisconsin
Distribution: Kali Linux
Posts: 122

Rep: Reputation: 15
How to custom create a service


I have a script file that I need to run as a service or sorts. Right now I can run it then just kill the pid when I want to shut it off. Id prefer a way to make it a service so I can type, for example:

service myservice stop

-to stop the service, and

service myservice start

- to start it.

Can anyone tell me how to do this? Or if theres a better way, please let me know.

Thanks again!
Old 02-07-2006, 07:35 PM   #2
Senior Member
Registered: Nov 2002
Location: pikes peak
Distribution: Slackware, LFS
Posts: 2,577

Rep: Reputation: 48
this is what bash scripting is make 2 scripts, one turns the service on, the other to turn it off, and execute like so.......
OR you can put the scripts in your home DIR. and put a link to them to the desktop and then all you have to do is click on the link to turn the service on/off.......easy
Old 02-07-2006, 07:50 PM   #3
LQ Guru
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,507

Rep: Reputation: 124Reputation: 124
If you want the standard redhat-like service command, look in /etc/init.d (most likely) at some of the scripts there and copy one for your own use and your command.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
sigaction() - how to create custom signals? rose_bud4201 Programming 22 08-20-2015 09:22 AM
How to create a custom desktop in linux playtime Linux From Scratch 6 11-07-2005 01:44 PM
Create custom CD crimsontide Debian 1 07-21-2005 02:40 PM
how to create a custom installer? bonzai-panthera Linux From Scratch 0 01-19-2004 04:04 AM
create custom log pravash Linux - General 2 10-03-2003 01:48 AM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:58 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration