Subversion Repositories Mokou

Rev

Rev 13 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 13 Rev 14
Line 1... Line 1...
1
/* $Id: service.c 13 2024-09-07 12:44:18Z nishi $ */
1
/* $Id: service.c 14 2024-09-07 13:07:50Z nishi $ */
2
 
2
 
3
#include "mk_service.h"
3
#include "mk_service.h"
4
 
4
 
5
#include <fcntl.h>
5
#include <fcntl.h>
6
#include <stdio.h>
6
#include <stdio.h>
Line 232... Line 232...
232
			struct mk_service* srv = services[i];
232
			struct mk_service* srv = services[i];
233
			char* log = mk_strcat("Stopping ", name);
233
			char* log = mk_strcat("Stopping ", name);
234
			mk_log(log);
234
			mk_log(log);
235
			free(log);
235
			free(log);
236
 
236
 
-
 
237
			srv->stopped = true; /* No more resurrecting */
-
 
238
 
237
			bool alive = false;
239
			bool alive = false;
238
 
240
 
239
			FILE* f = fopen(srv->pidfile, "r");
241
			FILE* f = fopen(srv->pidfile, "r");
240
			unsigned long long pid;
242
			unsigned long long pid;
241
			if(f != NULL){
243
			if(f != NULL){
Line 341... Line 343...
341
			if(!dead){
343
			if(!dead){
342
				mk_log("Could not kill the process");
344
				mk_log("Could not kill the process");
343
				return 6;
345
				return 6;
344
			}
346
			}
345
 
347
 
346
			srv->stopped = true;
-
 
347
			return 0;
348
			return 0;
348
		}
349
		}
349
	}
350
	}
350
	return 1;
351
	return 1;
351
}
352
}