Sponsored Content
Top Forums Shell Programming and Scripting Creating a daemon to run in background Post 302496324 by methyl on Sunday 13th of February 2011 03:31:07 PM
Old 02-13-2011
Quote:
* * * * * /path/to/Kill_Daemon.sh
It may be advisible to run the cron say every 10 minutes to allow the fault time to develop and to avoid overlapping kill scripts.

Code:
2,12,22,32,42,52 * * * * /path/to/Kill_Daemon.sh

@ukndoit
Normally I would have a rant about using "kill -9" (instead of a tidier kill command) but I recognise that orphan and looping ".cgi" processes are common and somewhat difficult to kill.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

applicatoin cannot started, becos daemon did not run

hi, i had an applicatoin which is not running cos one of its daemon is not running.. i get the applicatoin to run by running the daemon first... its manual job... so quite cumbersome.. i have backups in the night, with the crontab -l entry with logs written. the logs indicated successful... (7 Replies)
Discussion started by: yls177
7 Replies

2. 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

3. Programming

Creating a Daemon

how to convert a c program into a Daemon. thanks in advance svh (2 Replies)
Discussion started by: svh
2 Replies

4. UNIX for Dummies Questions & Answers

I would like to know Would you run the ‘identd’ daemon on UNIX servers?

Would you run the ‘identd' daemon on UNIX servers? can you please Explain. thanks in advance! (3 Replies)
Discussion started by: xoxouu
3 Replies

5. Shell Programming and Scripting

Run shell script as a daemon

I have simple shell script that I run as cron job every hour of the day. I would like to make it a daemon that runs far more frequently like every 30 seconds or so, but I have never made daemon before. How can I do this? -Sam (7 Replies)
Discussion started by: Sammy_T
7 Replies

6. 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

7. Shell Programming and Scripting

Creating background process for my shell

I actually posted this problem on a different forum, but figured this would be a more appropriate place to post it. OK so I've created my own shell, but I can't get the background process function to run properly! What I want to do is to run a process in the background, and also print when the... (2 Replies)
Discussion started by: hansel13
2 Replies

8. Shell Programming and Scripting

background scripts run-help

Looking for a logic where say i have a script called parent_script which is used to call other 4 to 5 child scripts in background as.. cat parent_script # containing 65 lines 1 2 .. 35 while read child_script 36 do 37 ./child_script_name& 38 done< ${SCRIPT_LISTS} 39 40 # Need to have... (2 Replies)
Discussion started by: michaelrozar17
2 Replies

9. Shell Programming and Scripting

run this script as a daemon process

Hi, HI , I have a simple script that moves files from one folder to another folder, I have already done the open-ssh server settings and the script is working fine and is able to transfer the files from one folder to another but right now I myself execute this script by using my creditianls to... (3 Replies)
Discussion started by: nks342
3 Replies

10. Shell Programming and Scripting

script to run as a daemon

Hi, I have one query that is suppose if I have a script that pick up some files from source folder and put it into destination folder , and I want this script to run after every 1 hour, to make it configurable as per that I have options like crontab and nohup but when I test this script I have to... (2 Replies)
Discussion started by: nks342
2 Replies
cmrunserv(1m)															     cmrunserv(1m)

NAME
cmrunserv - run a service from the high availability package run script SYNOPSIS
cmrunserv [-v] service_name service_command_string cmrunserv [-v] [-r restarts] service_name service_command_string cmrunserv [-v] [-R] service_name service_command_string DESCRIPTION
cmrunserv is used in the high availability package run script to run a service. To start package's service, a user must either be superuser(UID=0), or have an access policy of FULL_ADMIN allowed in the cluster configu- ration file. See access policy in cmquerycl(1m) or cmmakepkg(1m). If the service process dies, cmrunserv updates the status of the service to down. The cluster software will recognize the change in status and execute the normal package recovery sequence. This includes executing the package halt script, determining if the package can be run on a different node, and, if so, executing the package run script on the new node. Should the service_command be halted by the cmhaltserv command, a SIGTERM signal will be sent to the process. This executable or shell script should be able to handle a SIGTERM signal and execute a graceful shutdown performing any cleanup necessary. If the process ignores the SIGTERM, a SIGKILL will be sent to the process. If a SIGKILL is sent, the process will die immediately and will be unable to perform any cleanup. Options cmrunserv supports the following options. -v Verbose output will be displayed. -r restarts Indicates that the service should be automatically restarted by the cluster software if it fails, without halting the package. restarts indicates how many times the service may fail before the package should be halted. -R Indicates the service should be restarted an unlimited number of times if it fails. service_name Name of the service as it exists in the package configuration information. service_command_string Process string to be started. This includes the process name and any arguments necessary for the process to run. The process name must be a full path, may be either a command name or a shell script, and must be executable. RETURN VALUE
cmrunserv returns the following values: 0 Successful completion. 1 Command failed. EXAMPLES
To run the service command string /var/opt/db/database1 under the service name db1, do the following: # Run the process /var/opt/db/database1 cmrunserv db1 /var/opt/db/database1 This line should only be executed within a package run script. AUTHOR
cmrunserv was developed by HP. SEE ALSO
cmhaltserv(1m), cmquerycl(1m), cmmakepkg(1m), cmmodnet(1m). Requires Optional Serviceguard Software cmrunserv(1m)
All times are GMT -4. The time now is 09:54 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy