Displaying 3 results from an estimated 3 matches for "send_all_driv".
2010 Jul 22
1
problem with restarting nut
...es driver fail to start sometimes when old driver
is still running because "device is locked by another process". I've prepared
patch cloning stop_driver function to wait_driver_stoped which blocks until
timeout or until /proc/<pid> disappears. This function is called after
send_all_drivers(stop_driver). See attached patch.
If you don't want to make this changes I can modify init script restart
function instead to wait until all processes with pid in /var/run/nut/*.pid
files are dead, but I find this quite ugly.
Any comments?
Michal
2017 Jul 08
1
Trying to understand sdorder
...0
The order runs from 0 to the highest number available. So, for this
configuration, the order of shutdowns would be 'misc', 'littleguy', and
then 'bigone'.
3. But in upsdrvctl.c I see
/* walk UPS table and send command to all UPSes according to sdorder */
static void send_all_drivers(void (*command)(const ups_t *))
{
ups_t *ups;
int i;
...
for (i = 0; i <= maxsdorder; i++) {
ups = upstable;
while (ups) {
if (ups->sdorder == i)
command(ups);
ups = ups->next;
}
}
}
These nested loops will execute in a few milleseconds, effectively
shut...
2010 Jul 21
1
[PATCH] nut crashes when port= is omitted
Hi,
I've found that upsdrvctl crashes when there is not ports= specified ups.conf
#0 __strrchr_sse2 () at ../sysdeps/x86_64/strrchr.S:33
#1 xbasename (file=0x0) at common.c:266
#2 stop_driver (ups=0x1e163e0) at upsdrvctl.c:135
#3 send_all_drivers (command=0x4020f0 <stop_driver>) at upsdrvctl.c:446
#4 main (argc=1, argv=0x7ffff30be9c0) at upsdrvctl.c:565
stop_driver (ups=0x1e163e0) at upsdrvctl.c:135:
if (ret != 0) {
snprintf(pidfn, sizeof(pidfn), "%s/%s-%s.pid", altpidpath(),
ups->driver, xbasename(ups->p...