From steven at vaningelgem.be Fri Jul 3 10:40:06 2009 From: steven at vaningelgem.be (Steven Van Ingelgem) Date: Fri Jul 3 10:38:01 2009 Subject: [Klone-users] "LOG_DAEMON" syslog facility Message-ID: <5862ce3f0907030740h6ffe726cxf633326521ec91cc@mail.gmail.com> Hi, In /usr/include/sys/syslog.h there are several levels defined (outside the LOG_LOCAL0-7) which are not defined in klog.c. I am talking about: /* facility codes */ #define LOG_KERN (0<<3) /* kernel messages */ #define LOG_USER (1<<3) /* random user-level messages */ #define LOG_MAIL (2<<3) /* mail system */ #define LOG_DAEMON (3<<3) /* system daemons */ #define LOG_AUTH (4<<3) /* security/authorization messages */ #define LOG_SYSLOG (5<<3) /* messages generated internally by syslogd */ #define LOG_LPR (6<<3) /* line printer subsystem */ #define LOG_NEWS (7<<3) /* network news subsystem */ #define LOG_UUCP (8<<3) /* UUCP subsystem */ #define LOG_CRON (9<<3) /* clock daemon */ #define LOG_AUTHPRIV (10<<3) /* security/authorization messages (private) */ #define LOG_FTP (11<<3) /* ftp daemon */ /* other codes through 15 reserved for system use */ #define LOG_LOCAL0 (16<<3) /* reserved for local use */ #define LOG_LOCAL1 (17<<3) /* reserved for local use */ #define LOG_LOCAL2 (18<<3) /* reserved for local use */ #define LOG_LOCAL3 (19<<3) /* reserved for local use */ #define LOG_LOCAL4 (20<<3) /* reserved for local use */ #define LOG_LOCAL5 (21<<3) /* reserved for local use */ #define LOG_LOCAL6 (22<<3) /* reserved for local use */ #define LOG_LOCAL7 (23<<3) /* reserved for local use */ #define LOG_NFACILITIES 24 /* current number of facilities */ #define LOG_FACMASK 0x03f8 /* mask to extract facility part */ /* facility of pri */ #define LOG_FAC(p) (((p) & LOG_FACMASK) >> 3) Wouldn't it be nice to have those also in there? Grtz, Steven -------------- next part -------------- An HTML attachment was scrubbed... URL: http://koanlogic.com/pipermail/klone-users/attachments/20090703/846f488f/attachment.html From mickael.auger at gmail.com Tue Jul 21 10:42:40 2009 From: mickael.auger at gmail.com (Mickael Auger) Date: Tue Jul 21 10:39:40 2009 Subject: [Klone-users] Use relative paths in kloned.conf Message-ID: Hi KLone team, I hope you have had nice holidays ;) *** My objective : *** Use relative paths in kloned.conf (because the directory depends of unknown installation folder). *** My problem : *** I cannot use relative paths in my kloned.conf because "./" is replaced by "/". For example, my KLone binary ("kloned") is located in "/home/user1/" my kloned.conf specifies the log file : ==================================== log { type file file.basename ./tmp/log } ==================================== However, if I execute : $ cd /home/user1 /home/user1$ ./kloned the path "." is replace by "/" instead of "/home/user1/" and the getcwd() function gives the path "/". But if I execute : $ cd /home/user1 /home/user1/$ ./kloned -F the path "." is replace by "/home/user1/" and the getcwd() function gives the same path. This problem is linked to call daemon() function in "src/kloned/entry.c" and redefined in "libu/srcs/missing/daemon.c" that use "chdir("/")" : con_err_ifm(daemon(0, 0), "daemon error"); //line 401 src/kloned/entry.c We wish have the possibilty to call daemon() with daemon(1, 0). ** My question : ** Could you offer us an option in the main makefile as "--enabled_chdir_daemon" to add the value 1 to daemon() function ? Thanks. -- Micka?l AUGER -------------- next part -------------- An HTML attachment was scrubbed... URL: http://koanlogic.com/pipermail/klone-users/attachments/20090721/5a205064/attachment.htm From moises.acuna at gmail.com Tue Jul 28 13:54:41 2009 From: moises.acuna at gmail.com (moises acuna) Date: Tue Jul 28 14:01:48 2009 Subject: [Klone-users] Download files Message-ID: <4d3e3a030907281054j551647d9l8a396c0fa0fb5f3f@mail.gmail.com> Hello all, my problem is this, my embedded web application generates binary files and the user is capable to download them. I'm doing it like this: while ((read = fread (buff, 1, BUFFER_SIZE, target)) == BUFFER_SIZE) { io_write(out, buff, read); } // write the remaining data if (!ferror(target) && feof(target)) { io_write(out, buff, read); } 2 issues: 1. when the file is smaller than BUFFER_SIZE its obvious that it doesn't get into the while body but the fread is executed. then by debugging i'm positive that the remaining data is executed and the data is there in the buffer. But the download dialog in the browser doesn't show up. 2. when the file is bigger than the BUFFER_SIZE the dialog does come up and you can download the file, by debugging you can see the first iteration of the while and the content of the buffer but when it finish the downloaded file has 2 extra bytes at the beginning: 0A and 0D, these are new line and carriage return characters, the curious thing is that those characters are not in the buff array. I've tried to flush the out variable, to use the seek function , but nothing. If anyone had this very problem and/or knows how to solve it. Expecting for comments and thanks in advanced. -- Mois?s AAC -------------- next part -------------- An HTML attachment was scrubbed... URL: http://koanlogic.com/pipermail/klone-users/attachments/20090728/80c091e2/attachment.html From tho at koanlogic.com Tue Jul 28 22:52:29 2009 From: tho at koanlogic.com (thomas fossati) Date: Tue Jul 28 22:48:49 2009 Subject: [Klone-users] Download files In-Reply-To: <4d3e3a030907281054j551647d9l8a396c0fa0fb5f3f@mail.gmail.com> References: <4d3e3a030907281054j551647d9l8a396c0fa0fb5f3f@mail.gmail.com> Message-ID: Hi Moises, On Jul 28, 2009, at 7:54 PM, moises acuna wrote: > Hello all, > my problem is this, my embedded web application generates binary > files and the user is capable to download them. I'm doing it like > this: > [SNIP] > Expecting for comments and thanks in advanced. the following POC kl1 hopefully does what you need: <%! #include #define TEST_FN "/tmp/test" %><% size_t rb; char buf[1024]; FILE *target = NULL; target = fopen(TEST_FN, "r"); warn_err_sifm (target == NULL, "%s", TEST_FN); while ((rb = fread(buf, 1, sizeof buf, target)) != 0) (void) io_write(out, buf, rb); warn_if (!feof(target) && ferror(target)); // fall through err: if (target) fclose(target); return; %> ciao, t. PS: the '0xA 0xD' stuff gets in because you probably don't stick '%>< %' together: the kl1 parser interprets the new line literally which is clearly not what you want when pushing raw files. PS2: try to avoid "read" as a variable name as it's already taken by the syscall. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://koanlogic.com/pipermail/klone-users/attachments/20090729/894ba1a5/attachment.htm From moises.acuna at gmail.com Wed Jul 29 13:46:00 2009 From: moises.acuna at gmail.com (moises acuna) Date: Wed Jul 29 13:47:34 2009 Subject: [Klone-users] Download files In-Reply-To: References: <4d3e3a030907281054j551647d9l8a396c0fa0fb5f3f@mail.gmail.com> Message-ID: <4d3e3a030907291046k47860157q3be627a6475be6fc@mail.gmail.com> Hi Thomas, it worked nicely, thank you very much! 2009/7/28 thomas fossati > Hi Moises, > > On Jul 28, 2009, at 7:54 PM, moises acuna wrote: > > Hello all, > my problem is this, my embedded web application generates binary files and > the user is capable to download them. I'm doing it like this: > [SNIP] > Expecting for comments and thanks in advanced. > > > the following POC kl1 hopefully does what you need: > > <%! > #include > > #define TEST_FN "/tmp/test" > %><% > size_t rb; > char buf[1024]; > FILE *target = NULL; > > target = fopen(TEST_FN, "r"); > warn_err_sifm (target == NULL, "%s", TEST_FN); > > while ((rb = fread(buf, 1, sizeof buf, target)) != 0) > (void) io_write(out, buf, rb); > > warn_if (!feof(target) && ferror(target)); > > // fall through > err: > if (target) > fclose(target); > return; > %> > > ciao, t. > > PS: the '0xA 0xD' stuff gets in because you probably don't stick '%><%' > together: the kl1 parser interprets the new line literally which is clearly > not what you want when pushing raw files. > > PS2: try to avoid "read" as a variable name as it's already taken by the > syscall. > > _______________________________________________ > Klone-users mailing list > Klone-users@koanlogic.com > http://koanlogic.com/cgi-bin/mailman/listinfo/klone-users > > -- Mois?s AAC -------------- next part -------------- An HTML attachment was scrubbed... URL: http://koanlogic.com/pipermail/klone-users/attachments/20090729/40d78b29/attachment.html From steven at vaningelgem.be Fri Jul 31 06:56:23 2009 From: steven at vaningelgem.be (Steven Van Ingelgem) Date: Fri Jul 31 06:52:48 2009 Subject: [Klone-users] How to regenerate list of files to compile into kloned? Message-ID: <5862ce3f0907310356n2ce93df3ucb377d2c2d76ded9@mail.gmail.com> Hi, I added a file (webapp/www/js/chart.js). But this file is not compiled into kloned. If I do a make clean and than a make, it is... How can I regenerate the list of files which will be included into kloned without recompiling all of kloned? Thanks, Steven -------------- next part -------------- An HTML attachment was scrubbed... URL: http://koanlogic.com/pipermail/klone-users/attachments/20090731/f5b603dc/attachment.htm