Sponsored Content
Full Discussion: Creating a Daemon
Top Forums Programming Creating a Daemon Post 78232 by svh on Monday 18th of July 2005 02:55:43 AM
Old 07-18-2005
Daemon

thanks,

thanks a lot.

svh
 

9 More Discussions You Might Find Interesting

1. Programming

daemon

I want to write background running program. How to use daemon function. Please send me source code. Thanks. (1 Reply)
Discussion started by: bat_oyu
1 Replies

2. Shell Programming and Scripting

is this daemon effiecient???

I just wanted a script to touch my files once a day so they don't get removed once a day from cleaning, however I was wondering if it was the most effiecient method? comments are appreciated! command-prompt>nohup toucher.sh & Toucher.sh #!/usr/local/bin/bash while ((1)) do ... (2 Replies)
Discussion started by: Shakey21
2 Replies

3. Shell Programming and Scripting

Creating a Daemon??

How in the world do you create a daemon and get it to start with a startup script? could someone tell me in detail im going nuts...thanks (1 Reply)
Discussion started by: nmajin
1 Replies

4. Programming

Daemon

i want to write a daemon service which listens the 8080 port and write down all the details in one file. How can i do this ? (2 Replies)
Discussion started by: santosh123
2 Replies

5. Shell Programming and Scripting

créating a daemon under unix

hi i want to create a daemon under unix or linux but i don't really know how so i will be grateful if you provide me links with examples or /andx how to do it thanks (2 Replies)
Discussion started by: student00
2 Replies

6. Shell Programming and Scripting

help needed with creating challenging bash script with creating directories

Hi, Can someone help me with creating a bash shell script. I need to create a script that gets a positive number n as an argument. The script must create n directories in the current directory with names like map_1, map_2 etcetera. Each directory must be contained within its predecessor. So... (7 Replies)
Discussion started by: I-1
7 Replies

7. Shell Programming and Scripting

Creating a daemon to run in background

I am trying to create a service to always run and monitor a script that has a tendency to hang, we could not find what is causing it to hang so are in the process of completely reprogramming just about everything, however, that will take upto 6 months. So I need to create this to monitor the... (5 Replies)
Discussion started by: ukndoit
5 Replies

8. Homework & Coursework Questions

Creating a .profile, displaying system variables, and creating an alias

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Here is what I am supposed to do, word for word from my assignment page: 1. Create/modify and print a... (2 Replies)
Discussion started by: Jagst3r21
2 Replies

9. Programming

Daemon process

I wish to make a process run in the background, but only one instance of it, and not many, so when the program is loaded, it has to check whether another instance of the same program is running and if so to exit. How do I do this ? (4 Replies)
Discussion started by: sundaresh
4 Replies
Net::Daemon::Test(3)					User Contributed Perl Documentation				      Net::Daemon::Test(3)

NAME
Net::Daemon::Test - support functions for testing Net::Daemon servers SYNOPSIS
# This is the server, stored in the file "servertask". # # Create a subclass of Net::Daemon::Test, which in turn is # a subclass of Net::Daemon use Net::Daemon::Test (); package MyDaemon; @MyDaemon::ISA = qw(Net::Daemon::Test); sub Run { # Overwrite this and other methods, as you like. } my $self = Net::Daemon->new(\%attr, @options); eval { $self->Bind() }; if ($@) { die "Server cannot bind: $!"; } eval { $self->Run() }; if ($@) { die "Unexpected server termination: $@"; } # This is the client, the real test script, note we call the # "servertask" file below: # # Call the Child method to spawn a child. Don't forget to use # the timeout option. use Net::Daemon::Test (); my($handle, $port) = eval { Net::Daemon::Test->Child(5, # Number of subtests 'servertask', '--timeout', '20') }; if ($@) { print "not ok 1 $@ "; exit 0; } print "ok 1 "; # Real tests following here ... # Terminate the server $handle->Terminate(); DESCRIPTION
This module is a frame for creating test scripts of Net::Daemon based server packages, preferrably using Test::Harness, but that's your choice. A test consists of two parts: The client part and the server part. The test is executed by the child part which invokes the server part, by spawning a child process and invoking an external Perl script. (Of course we woultn't need this external file with fork(), but that's the best possibility to make the test scripts portable to Windows without requiring threads in the test script.) The server part is a usual Net::Daemon application, for example a script like dbiproxy. The only difference is that it derives from Net::Daemon::Test and not from Net::Daemon, the main difference is that the Bind method attempts to allocate a port automatically. Once a port is allocated, the number is stored in the file "ndtest.prt". After spawning the server process, the child will wait ten seconds (hopefully sufficient) for the creation of ndtest.prt. AVAILABLE METHODS
Server part Options Adds an option --timeout to Net::Daemon: The server's Run method will die after at most 20 seconds. Bind (Instance method) This is mainly the default Bind method, but it attempts to find and allocate a free port in two ways: First of all, it tries to call Bind with port 0, most systems will automatically choose a port in that case. If that seems to fail, ports 30000-30049 are tried. We hope, one of these will succeed. :-) Run (Instance method) Overwrites the Net::Daemon's method by adding a timeout. sub Run ($) { my $self = shift; $self->Run(); } Client part Child (Class method) Attempts to spawn a server process. The server process is expected to create the file 'ndtest.prt' with the port number. The method returns a process handle and a port number. The process handle offers a method Terminate that may later be used to stop the server process. AUTHOR AND COPYRIGHT
Net::Daemon is Copyright (C) 1998, Jochen Wiedmann Am Eisteich 9 72555 Metzingen Germany Phone: +49 7123 14887 Email: joe@ispsoft.de All rights reserved. You may distribute under the terms of either the GNU General Public License or the Artistic License, as specified in the Perl README file. SEE ALSO
Net::Daemon(3), Test::Harness(3) perl v5.12.1 2007-05-23 Net::Daemon::Test(3)
All times are GMT -4. The time now is 07:28 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy