fiss-minit

A standalone service supervisor based on minit
Log | Files | Refs | README | LICENSE

commit 6859dc5cbfb546ab81b751883e3b1fdf63eb1602
parent cbf3cece21a369005e0f2de6956729e1e99b469c
Author: leitner <leitner>
Date:   Tue, 27 May 2003 10:51:39 +0000

fix shutdown (Thomas Schwinge)

Diffstat:
Mshutdown.c | 9++++++---
1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/shutdown.c b/shutdown.c @@ -116,11 +116,12 @@ int minit_serviceDown(char *service) { if (i == 0) __write2("\t\tdone\n"); else __write2("\t\tfailed\n"); } - close(infd); close(outfd); return 0; } int minit_shutdown(int level) { + int retval; + __write2("Shutting down minit services: \n"); infd=open("/etc/minit/in", O_WRONLY); outfd=open("/etc/minit/out", O_RDONLY); @@ -131,7 +132,9 @@ int minit_shutdown(int level) { } } - return minit_serviceDown(level?"halt":"reboot"); + retval=minit_serviceDown(level?"halt":"reboot"); + close(infd); close(outfd); + return retval; } #endif @@ -243,7 +246,7 @@ int main(int argc, char *const argv[]) { /* sync buffers */ sync(); - exec_cmd("/bin/swapoff", "swapoff", "-a", (char *) 0); + exec_cmd("/sbin/swapoff", "swapoff", "-a", (char *) 0); exec_cmd("/bin/umount", "umount", "-a", (char *) 0); exec_cmd("/bin/mount", "mount", "-o", "remount,ro", "/", (char *) 0);