Index: control.c =================================================================== RCS file: /cvsroot/monit/monit/control.c,v retrieving revision 1.2 diff -r1.2 control.c 43c43 < --- > Command_T check_script(Process_T p, char *action); 140,143d139 < if(! p->start) { < error("start: '%s' the start program is not defined\n", p->name); < return; < } 150,151c146,149 < if(! p->stop) { < error("stop: '%s' the stop program is not defined\n", p->name); --- > > if(! check_script(p, action)) { > error("%s: '%s' the %s program is not defined\n", > p->name, action, action); 153a152 > 202,207c201,202 < if(is(action, "start")) { < spawn(p, p->start); < } < else if(is(action, "stop")) { < spawn(p, p->stop); < } --- > > spawn(p, check_script(p, action)); 230a226,244 > } > > /* > * Return a pointer to start/stop Command_T object > * @param p A Process T object @param action A start/stop action > */ > Command_T check_script(Process_T p, char *action) { > > Command_T c = NULL; > > if(is(action, "start")) { > c= p->start; > } > else if(is(action, "stop")) { > c= p->stop; > } > > return c; >