Configuring Shell Script as service/daemon
Hi All,
I have script to tail the log file of httpd-access_log file. How can i configure the same script as service using xinetd. I need to run service for the specific port i would like to listen. Thank you Kanthi Kiran |
How can i configure the same script as service using xinetd. I need to run service for the specific port i would like to listen.
Here is an example using "who". Working with your script should be similar. Steps: I. Register port in local services database. echo "test tcp/34463" >> /etc/services Test with "getent services test". II. Make sure firewall accepts connection to port TCP/34463 FOR LOCAL SUBNET ONLY. After all this is an example. For this example we used subnet 10.1.1.0/24. III. create /etc/xinetd.d/test with contents: Code:
# default: off - 10.1.1.2 with the IP address of your ethernet device. - 10.1.1.0/24 with the IP subnet IP of your ethernet device. (Re)start Xinetd. Test with "nc IP_address 34463" or send your browser to "http://IP_address:34463". BIG FAT WARNING - Do not make such services publicly accessable unless you understand the implications. Make use of Xinetd's restrictive features like cps, max load, rlimit cpu, shield the port using Xinetd's "only_from" and your firewall regardless AND TEST BEFORE DEPLOYING, - Do not allow the service to interact with remote user input EVER, - Do monitor your Xinetd log. HTH |
Thank You.
I am done with my requirement and your reply was additional support for my documentation Thank you once again |
All times are GMT -5. The time now is 11:32 PM. |