cmdl[0] = 0;
int ret;
+ assert(inst->drv->upscript);
+ assert(inst->label);
+
snprintf(cmdl, 1024, "%s up %s %d %d",
inst->drv->upscript, inst->label, inst->major, inst->dev_id);
dbg("Running Upscript: \"%s\"", cmdl);
cmdl[0] = 0;
int ret;
+ assert(drv->upscript);
+ assert(drv->devprefix);
+
snprintf(cmdl, 1024, "%s clean %s ",
drv->upscript, drv->devprefix);
dbg("Running Upscript: \"%s\"", cmdl);
cmdl[0] = 0;
int ret;
+ assert(inst->drv->downscript);
+ assert(inst->label);
+
snprintf(cmdl, 1024, "%s down %s %d",
inst->drv->downscript, inst->label, inst->major);
cmdl[0] = 0;
int ret;
+ assert(inst->label);
+
snprintf(cmdl, 1024, "%s down %s %d",
SERVICE_BINARY, inst->label, inst->dev_id);
dbg("executing service: \"%s\"", cmdl);
return ENOMEM;
}
+ assert(inst->drv->binary);
+ assert(inst->label);
+
snprintf(cmdl, 1024, "%s up %s -major %d -devid %d -label %s",
SERVICE_BINARY, inst->drv->binary, inst->major, inst->dev_id,
inst->label);
/* quit all running drivers */
LIST_FOREACH(inst, &instances, list) {
dbg("stopping driver %s", inst->label);
- run_downscript (inst);
+ if(inst->drv->downscript) {
+ run_downscript (inst);
+ }
stop_driver(inst);
}
unlink("/var/run/devmand.pid");
parse_config();
LIST_FOREACH(driver, &drivers, list) {
- run_cleanscript(driver);
+ if (driver->upscript) {
+ run_cleanscript(driver);
+ }
}
signal(SIGINT, sig_int);