LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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.

Notices

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

Rep: Reputation: 15
How to custom create a service


Hi.

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
320mb
Senior Member
 
Registered: Nov 2002
Location: pikes peak
Distribution: Slackware, LFS
Posts: 2,577

Rep: Reputation: 47
this is what bash scripting is for.........you make 2 scripts, one turns the service on, the other to turn it off, and execute like so.......
Code:
./service_on
./service_off
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
Matir
Moderator
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,507

Rep: Reputation: 117Reputation: 117
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.
 
  


Reply


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 15 05-24-2006 06:04 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


All times are GMT -5. The time now is 07:45 AM.

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