From: Cassiano M. <cas...@at...> - 2007-06-08 18:03:42
|
nope, mysql connection will be closed after finish, and all buffers will be re-used. static variables will remain in memory, as long the daemon is shut down. I dont use any dynamic allocated variables, and I think it will not eat memory. valgrind reports about ~700k of memory lost when the program exits, because I dont free them. this is the memory costs, more or less. I'll code this carefully, as I know this kind of problems. It wont be my first daemon :-) José Queiroz escreveu: > Cassiano, and what about resource comsumption??? Running as a > [permanent] daemon will [permanently] use a reasonable amount of > memory... > > 2007/6/8, Cassiano Martin <cas...@at...>: > >> I understand the security risks, the daemon would run as a common user, >> and not as root. if a cracker steals information from it, he could get >> mysql password and user. >> but this is visible on the configuration file, anyway. only if you chmod >> it and make it read only to the daemon user. >> running a daemon as root is really risky, even with squid, bind, popper, >> etc... >> >> well, all memory copy operations, i'm doing with strncpy, which copies >> strings based on the destination variable size. >> the most common attack is on this operations, where it could overflow >> memory areas, leading an attack. >> I'm also debuggin' it with valgrind, its a powerful tool to find memory >> leaks. >> >> []'s >> Cassiano Martin >> >> Giannis Stoilis escreveu: >> >>> On 6/8/07, Cassiano Martin <cas...@at...> wrote: >>> >>> >>>> I'm thinking in make the importer became a daemon, so it will have its >>>> own timer, and do his job on the >>>> >>>> >>> A daemon is complicated. You have to worry about stuff like memory >>> leaks, security etc. If you're up to the task though, go ahead! >>> >>> >>> >>>> Mysar php can also be used for import later logs. the only problem is >>>> that if you have a cron job, it will run >>>> twice. >>>> >>>> >>> Than can be solved via proper lock mechanisms, something which I >>> however, was unable to implement properly. >>> >>> ------------------------------------------------------------------------- >>> This SF.net email is sponsored by DB2 Express >>> Download DB2 Express C - the FREE version of DB2 express and take >>> control of your XML. No limits. Just data. Click to get it now. >>> http://sourceforge.net/powerbar/db2/ >>> _______________________________________________ >>> mysar-support mailing list >>> mys...@li... >>> https://lists.sourceforge.net/lists/listinfo/mysar-support >>> >>> >>> >>> >> ------------------------------------------------------------------------- >> This SF.net email is sponsored by DB2 Express >> Download DB2 Express C - the FREE version of DB2 express and take >> control of your XML. No limits. Just data. Click to get it now. >> http://sourceforge.net/powerbar/db2/ >> _______________________________________________ >> mysar-support mailing list >> mys...@li... >> https://lists.sourceforge.net/lists/listinfo/mysar-support >> >> > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > mysar-support mailing list > mys...@li... > https://lists.sourceforge.net/lists/listinfo/mysar-support > > > |