Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 06-01-2004, 09:11 AM   #1
LQ Newbie
Registered: Jun 2004
Location: Toronto, Ontario
Posts: 2

Rep: Reputation: 0
Question How to register a Tcl script as a service?

Hi all,
I have a Tcl script that runs all the time (takes actions based on the logic).
Right now I manually run the script from a shell every time the box is rebooted. I am wondering if there is a functionality to register the script as a "service" ( daemon could be the correct term, my apologies) ?
Thank you all in advance.
Old 06-01-2004, 09:31 AM   #2
Registered: Jul 2003
Location: netherlands
Distribution: debian
Posts: 403

Rep: Reputation: 30
you could include the script in the boot sequence, wich will start it automaticly on boot depends on the init style how this is done... for slackware style boot (don't know official name): edit the /etc/rc.d/rc.local file and put the command to start the script at the end, for SysV init style, it's a bit more tricky. You'll have to put a script wich starts the Tcl script in the /etc/init.d dir, and create a symlink with S<nr><scriptname> to the script in the /etc/init.d/rc<runlevel>.d/ directory to the script... the script wich starts the Tcl script must accept an option "start" to start the 'service', your Tcl script (see other scripts in the /etc/init.d/ directory for examples) and it may accept an option "stop" to stop the Tcl script (on shutdown for example). To make it stop you must make a symlink like K<nr><scriptname> in the /etc/init.d/rc<runlevel>.d/ directory. <nr> means a number from 00 to 99 wich tells the init in wich order the scripts are executed.

.-=~ iluvatar ~=-.
Old 06-01-2004, 10:14 AM   #3
LQ Newbie
Registered: Jun 2004
Location: Toronto, Ontario
Posts: 2

Original Poster
Rep: Reputation: 0
I have Red Hat release 7.1 with OS release 2.4.2-2
Where do I edit the boot sequence


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 Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Register rpc service on a remote machine? sokar Programming 1 07-26-2005 05:49 PM
use file content as tcl script parameters powah Linux - General 3 07-16-2005 11:10 AM
How do I run a PHP script as a service? robbiemorgan Linux - Newbie 3 04-13-2005 02:03 PM
How to start a Tcl/Tk script by simply invoking the script file itself ? cyu021 Programming 2 10-10-2004 11:00 AM
Starting a service in a bash script AMMullan Programming 3 02-19-2004 11:06 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:38 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