AOLserver Chat Logs

2007/09/07

IRC [03:14] *** CMxS parted the chat.
IRC [05:56] *** cacrus joined the chat.
IRC [06:28] *** cacrus parted the chat.
IRC [07:45] *** IEF joined the chat.
IRC [09:21] *** tekbasse joined the chat.
IRC [09:47] <Dossy_> hi, tekbasse :)
IRC [11:32] *** Dossy_ parted the chat.
IRC [11:32] *** holymoly joined the chat.
IRC [11:33] *** Dossy_ joined the chat.
IRC [12:15] *** jediphong joined the chat.
IRC [12:15] *** jediphong parted the chat.
IRC [12:42] <partymola> Dossy_: i have... a problem...
IRC [12:42] <partymola> when nsd dies, it does NOT create a core file :S
IRC [12:58] <Dossy_> are you setting ulimit -c before starting the nsd?
IRC [12:59] <Dossy_> from the control port, exec ulimit -c, what's it say?
IRC [12:59] <partymola> will do later, i have to leave for a sec
IRC [12:59] <partymola> later i'll active the controlport and such ;)
IRC [13:04] <Dossy_> ok
IRC [13:13] <Dossy_> ARGH. crap
IRC [15:32] *** daguz parted the chat.
IRC [16:21] <tekbasse> Hi Dossy =)
IRC [16:28] *** tekbasse parted the chat.
IRC [17:10] *** holymoly parted the chat.
IRC [17:25] *** cacrus joined the chat.
IRC [17:48] *** holymoly joined the chat.
IRC [18:24] <partymola> Dossy: webstats:nscp 1> exec ulimit -c
IRC [18:24] <partymola> couldn't execute "ulimit": no such file or directory
IRC [18:24] <Dossy_> yeah.
IRC [18:24] <Dossy_> exec sh -c "ulimit -c"
IRC [18:24] <Dossy_> it's a shell thing :)
IRC [18:24] <partymola> webstats:nscp 2> exec sh -c "ulimit -c"
IRC [18:24] <partymola> unlimited
IRC [18:24] <partymola> internal command, i c
IRC [18:24] <Dossy_> weird. ulimit -a ?
IRC [18:24] <Dossy_> errr, i meant uname -a
IRC [18:25] <partymola> webstats:nscp 5> exec sh -c "uname -a"
IRC [18:25] <partymola> FreeBSD flagg 6.2-STABLE FreeBSD 6.2-STABLE #1: Wed Aug 1 23:48:51 CEST 2007 josemaria@flagg:/usr/obj/usr/src/sys/GENERIC i386
IRC [18:25] <partymola> heh
IRC [18:25] <Dossy_> ph/
IRC [18:25] <Dossy_> oh.
IRC [18:25] <partymola> thing is... other programs give core dumps, but nsd doesn't!
IRC [18:25] <Dossy_> you're going to have to ask someone who knows FreeBSD well if FreeBSD will drop core of a multithreaded setuid program :)
IRC [18:26] <partymola> program is not setuid xD
IRC [18:26] <partymola> it's run as root :)
IRC [18:26] <Dossy_> I know Solaris does. Linux didn't until a relatively modern kernel. I don't know if FreeBSD does.
IRC [18:26] <partymola> ok
IRC [18:26] <Dossy_> runs as root and setuid()'s to drop privs
IRC [18:26] <partymola> ok
IRC [18:26] <partymola> i'm going to ask in the FreeBSD channel
IRC [18:27] <Dossy_> ok
IRC [18:28] <partymola> i.e. ruby fails sometimes, and gives core dump
IRC [18:28] <partymola> and other programs, when fail, they give it too
IRC [18:28] <partymola> but nsd, launched the same as them, doesn't
IRC [18:28] <partymola> it's weird
IRC [18:28] <partymola> and given the signal number nsd says... its default action is to core dump
IRC [18:38] *** cacrus parted the chat.
IRC [19:54] <Dossy_> partymola: okay, I think I've found the answer for y ou
IRC [19:55] <Dossy_> http://www.syndrowm.com/2007/08/freebsd-setuid-core.html
IRC [19:55] <Dossy_> $ sysctl kern.sugid_coredump=1
IRC [19:55] <Dossy_> kern.sugid_coredump: 0 -> 1
IRC [19:55] <Dossy_> $ sysctl kern.corefile="/var/coredumps/%N/%P.core"
IRC [19:55] <Dossy_> kern.corefile: /var/coredumps/%N/%P.core -> /var/coredumps/%N/%P.core
IRC [19:55] <Dossy_> $ mkdir /var/coredumps/[process name]
IRC [19:55] <Dossy_> $ chown [process owner] /var/coredumps/[process name]
IRC [19:55] <Dossy_> %N = process name
IRC [19:55] <Dossy_> %P = process id
IRC [19:55] <Dossy_> from core
IRC [19:55] <Dossy_> $ sysctl kern.sugid_coredump=1
IRC [19:55] <Dossy_> kern.sugid_coredump: 0 -> 1
IRC [19:55] <Dossy_> $ sysctl kern.corefile="/var/coredumps/%N/%P.core"
IRC [19:55] <Dossy_> kern.corefile: /var/coredumps/%N/%P.core -> /var/coredumps/%N/%P.core
IRC [19:55] <Dossy_> $ mkdir /var/coredumps/[process name]
IRC [19:55] <Dossy_> $ chown [process owner] /var/coredumps/[process name]
IRC [19:55] <Dossy_> %N = process name
IRC [19:55] <Dossy_> %P = process id
IRC [19:55] <Dossy_> from core
IRC [19:56] <Dossy_> oops, ack
IRC [19:56] <Dossy_> http://www.freebsd.org/cgi/man.cgi?query=core&apropos=0&sektion=0&manpath=FreeBSD+6.2-RELEASE&format=html
IRC [19:56] <Dossy_> the important part here is the kern.sguid_coredump=1
IRC [19:57] <Dossy_> be careful, because on a shared host, allowing binaries that setuid()/setgid() to write a corefile can be a security vulnerability (!)
IRC [19:57] <partymola> true, Dossy
IRC [19:57] <partymola> sysctl kern.sugid_coredump
IRC [19:57] <partymola> kern.sugid_coredump: 0
IRC [19:57] <partymola> i am gonna work on it then
IRC [19:57] <Dossy_> but, presumably you don't allow ordinary users to log into your production web hosts :)
IRC [19:58] <partymola> it's a small co. owed only by partners, so it's safe
IRC [19:58] <partymola> plus i only want this to get one core dump
IRC [19:59] <partymola> after that, i'll deactivate it
IRC [19:59] <Dossy_> right
IRC [20:01] <partymola> ok, relaunched nsd, and now i have the core dumps for sguid programs activated
IRC [20:01] <partymola> thanks a lot, Dossy
IRC [20:01] <Dossy_> cool.
IRC [20:02] <partymola> i hope we get the desired coredump soon :D
IRC [22:23] *** holymoly parted the chat.