LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices

Reply
 
Search this Thread
Old 04-01-2009, 12:22 PM   #1
onlymed
LQ Newbie
 
Registered: Apr 2009
Posts: 2

Rep: Reputation: 0
Set a Perl script as an unix service (start with system)


Hello ,
I have a real probleme with my servers :
I have created a Client (script) <-> server (daemon) application (works fine) using SOAP::Lite

If the server is launched using the line command everything works well and the requests are received and the answers sent.

Once i try to set the server side as a real service using : /etc/init.d/ the server is not started at the start time.

And if i use the commande /etc/init.d/myservice start - to start it : the server starts , listens to requests but do nothing else .
however when i use netstat -a | grep myport i see that there are an established connexion between client and server .
i really don't know how to solve this probleme.

Another try was to set a cron task which will start the perl daemon:

cron starts a bash script (myTask.sh) which will see if the server is already on if no starts it (myServer.pl). (like a watchdog) and i got another problème myServer.pl is killed once the myTask.sh finish .
i tried with nohup nothing done . and is i use disown in the .sh file i got the error disown not found .

Thanks for help
 
Old 04-01-2009, 03:25 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,999
Blog Entries: 11

Rep: Reputation: 881Reputation: 881Reputation: 881Reputation: 881Reputation: 881Reputation: 881Reputation: 881
Hi, welcome to LQ!


Quote:
Originally Posted by onlymed View Post
Hello ,
Once i try to set the server side as a real service using : /etc/init.d/ the server is not started at the start time.
Please elaborate on *what* you did there. Just putting a script
into that directory will NOT execute it on boot. You need to
have an appropriate symlink to it in one of the rc[23].d directories



Cheers,
Tink
 
Old 04-01-2009, 03:59 PM   #3
onlymed
LQ Newbie
 
Registered: Apr 2009
Posts: 2

Original Poster
Rep: Reputation: 0
Thanks for your replay :
i put a script in
Code:
/etc/init.d/
and also create links in rc2 ...

If i launch the created service manually :
Code:
/etc/init.d/myService start
the server starts, listen to requests, but didn't answer.

If i starts it using Perl PATH_SERVER/myServer.PL , it works fine
i really don't see where is the problem .

Thanks again for help .
 
  


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to set a service to start any time the system reboot phongly2000 Linux - Newbie 3 01-16-2009 12:48 PM
How can I make my perl script start when system boots up in HP-UX and in IBM-AIX mach Nings Programming 1 11-26-2008 03:03 AM
LXer: Maximizing Set Match Probability Using Perl On Linux Or Unix LXer Syndicated Linux News 0 09-12-2008 02:30 PM
The Best Method to install Set up a Unix System with PERL, PHP and Apache rhuser Linux - Software 1 03-01-2003 11:31 PM


All times are GMT -5. The time now is 02:19 PM.

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