09-10-2013
I need to dynamically name a fnction so a watchdog script can identify a process.
so I need to append a parameter to a function name.
If you have any idea on how to do this I would be grateful.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I want to launch some shell scripts.
I would have the possibility to change the number of shell scripts launched dynamically by modifying a variable, or a configuration file.
For example, I start to launch 4 scripts at the same time, and after that, by modifying a variable, 6 scripts are... (0 Replies)
Discussion started by: gonzo38
0 Replies
2. Shell Programming and Scripting
Hallo,
I am working on a kdialog. This shall be able to load the required commands from a .conf file.
First step runs good by loading the entries (selectabel entries) in a variable:
MIRRORSELECT=$(kdialog --radiolist "Select your nearest mirror" $VAR1)
The kdialog is accordingly correct... (2 Replies)
Discussion started by: ACTGADE
2 Replies
3. Shell Programming and Scripting
Hi All,
I want to create a shell script which dynamically create text files. i am using the following script
$i=1
while
do
cat > test_$i.txt
done
but while running the script it was stopping(the cursor not going to next step, i have to enter ctrl+c to make it stop). it is creating only... (2 Replies)
Discussion started by: KiranKumarKarre
2 Replies
4. Programming
Hi.
I need help with a C/C++ question and i hope someone can help me or give me some ideas.
Is possible to build a function C/C++ call dynamically? I.e, i have an array with pointer functions and these functions can have different number of parameters and types. These parameters and their... (14 Replies)
Discussion started by: pogdorica
14 Replies
5. Shell Programming and Scripting
I am needing to create a variable(changing) and assign it a value(changing) ... I am using C-Shell..
Example:
foreach account in ($Accountlist)
set account_connect = "$account/$account_pass"
end
I want to make set account_connect to store various values ? $account_connect did not... (3 Replies)
Discussion started by: shafi2all
3 Replies
6. Shell Programming and Scripting
how can i CREATE a txt file dynamically in c shell:
for instance:
#! /bin/csh
for each i (*)
cat>file$i.txt
for each j
do .... (1 Reply)
Discussion started by: jdsignature88
1 Replies
7. Shell Programming and Scripting
Hi,
I'm trying to use a config file to define frequencies for checking log files. If the config file contains a frequency it will be used else a default value. The format of the config file (and hence the environment variable) is
FREQ_log_logname=value
A test shell script as below:... (2 Replies)
Discussion started by: u671296
2 Replies
8. UNIX for Beginners Questions & Answers
I have to send a data in mail table format.only one cell need to get dynamically from query.
my code is like
(echo '<table boarder="1">
echo '<tr><td>stock</td><td>/path</td><td>.........</td></tr>'
echo '</table>
)sendmail..
in ......... I am trying to get query result.By putting query... (2 Replies)
Discussion started by: meera_123
2 Replies
9. Homework & Coursework Questions
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:
2. Relevant commands, code, scripts, algorithms:
#! /bin/ksh
v="ORG_ID"
... (2 Replies)
Discussion started by: sujitdas2104
2 Replies
10. Shell Programming and Scripting
Hello,
I have a requirement to apply hashing algorithm on flat file on one or more columns dynamically based on header
sample input file
ID|NAME|AGE|GENDER
10|ABC|30|M
20|DEF|20|F
say if i want multiple columns based on the header example id,name or id,age or name,gender and hash and... (13 Replies)
Discussion started by: mkathi
13 Replies
LEARN ABOUT FREEBSD
sw_watchdog
WATCHDOG(4) BSD Kernel Interfaces Manual WATCHDOG(4)
NAME
watchdog -- hardware and software watchdog
SYNOPSIS
#include <sys/watchdog.h>
DESCRIPTION
The watchdog facility is used for controlling hardware and software watchdogs.
The device /dev/fido responds to a single ioctl(2) call, WDIOCPATPAT. It takes a single argument which represents a timeout value specified
as a power of two nanoseconds, or-ed with a flag selecting active or passive control of the watchdog.
WD_ACTIVE indicates that the watchdog will be kept from timing out from userland, for instance by the watchdogd(8) daemon. WD_PASSIVE indi-
cates that the watchdog will be kept from timing out from the kernel.
The ioctl(2) call will return success if just one of the available watchdog(9) implementations supports setting the timeout to the specified
timeout. This means that at least one watchdog is armed. If the call fails, for instance if none of watchdog(9) implementations support the
timeout length, all watchdogs are disabled and must be explicitly re-enabled.
To disable the watchdogs pass WD_TO_NEVER. If disarming the watchdog(s) failed an error is returned. The watchdog might still be armed!
RETURN VALUES
The ioctl returns zero on success and non-zero on failure.
[EOPNOTSUPP] No watchdog present in the kernel or none of the watchdogs supports the requested timeout value (timeout value other than
0).
[EOPNOTSUPP] Watchdog could not be disabled (timeout value of 0).
[EINVAL] Invalid flag combination passed.
EXAMPLES
#include <paths.h>
#include <sys/watchdog.h>
#define WDPATH "/dev/" _PATH_WATCHDOG
int wdfd = -1;
static void
wd_init(void)
{
wdfd = open(WDPATH, O_RDWR);
if (wdfd == -1)
err(1, WDPATH);
}
static void
wd_reset(u_int timeout)
{
if (ioctl(wdfd, WDIOCPATPAT, &timeout) == -1)
err(1, "WDIOCPATPAT");
}
/* in main() */
wd_init();
wd_reset(WD_ACTIVE|WD_TO_8SEC);
/* potential freeze point */
wd_reset(WD_TO_NEVER);
Enables a watchdog to recover from a potentially freezing piece of code.
options SW_WATCHDOG
in your kernel config adds a software watchdog in the kernel, dropping to KDB or panic-ing when firing.
SEE ALSO
watchdogd(8), watchdog(9)
HISTORY
The watchdog code first appeared in FreeBSD 5.1.
AUTHORS
The watchdog facility was written by Poul-Henning Kamp <phk@FreeBSD.org>. The software watchdog code and this manual page were written by
Sean Kelly <smkelly@FreeBSD.org>. Some contributions were made by Jeff Roberson <jeff@FreeBSD.org>.
BUGS
The WD_PASSIVE option has not yet been implemented.
BSD
December 21, 2009 BSD