X-Git-Url: http://git.vrable.net/?a=blobdiff_plain;f=nfs3%2Fnfsd.c;h=fc1f955e91a229288962731bfe6979dc744a64e3;hb=1fc8461814b84ef7eaa3436c1fd826e8c63c1537;hp=7a0338d6d2fbb50b08d1a123f66938a4a5d20a69;hpb=2246171d841d34e6368e340a6b76b7ee9d9a1084;p=bluesky.git diff --git a/nfs3/nfsd.c b/nfs3/nfsd.c index 7a0338d..fc1f955 100644 --- a/nfs3/nfsd.c +++ b/nfs3/nfsd.c @@ -17,15 +17,45 @@ #include #include #include +#include + +#include "bluesky.h" void register_rpc(); +BlueSkyFS *fs; +BlueSkyStore *store; + +static void shutdown_handler(int num) +{ + g_print("SIGINT caught, shutting down...\n"); + g_print("Proxy statistics:\n"); + bluesky_stats_dump_all(); + exit(1); +} + int main(int argc, char *argv[]) { + int i; + + signal(SIGPIPE, SIG_IGN); + signal(SIGINT, shutdown_handler); + + bluesky_init(); + g_set_prgname("nfsd"); + + const char *target = getenv("BLUESKY_TARGET"); + if (target == NULL) + target = "s3"; + + store = bluesky_store_new(target); + fs = bluesky_init_fs("export", store); + register_rpc(); - svc_run (); - fprintf (stderr, "%s", "svc_run returned"); - exit (1); - /* NOTREACHED */ + bluesky_debug_dump(fs); + + svc_run(); + fprintf(stderr, "%s", "svc_run returned"); + exit(1); }