-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

So Upstart used to have this thing called logd and it would collect and
condense all of your service's console messages and make them available.
It was all well and good, but the problem was killing logd took down the
rest of the system since further writes to stdio caused SIGPIPE.
Ultimately it was decided that shipping an additional daemon beside
syslogd was a bad idea anyway and that we should look into enhancing
that mechanism.

But this still leaves the issue of getting stdio from the process to the
logging daemon. I still don't know how to do this, but I have sort of
half an idea that would make it work.

To do this, we must assume ptracing all the services isn't horrible and
stupid. Figuring out how to do it without making that assumption is the
other half of the idea that I don't have yet. Scott just found out how
to get rid of ptrace for the last reason we had it. We don't need to put
it back in.

Anyway, suppose we ptraced a service, and suppose it had stderr set to
/dev/null. Now, the error messages are going nowhere. BUT, because we've
traced the process, we know about all the sytem calls. So we simply
intercept any write() calls with 2 as the file descriptor argument and
read off the data being written directly. There's no worrying about what
happens if either end dies, since technically there's no connection.
We're watching the IO, we're not actually participating.

So there's a starting point. Anyone care to do the next iteration?

- --CJD
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iEYEARECAAYFAknFqFsACgkQIHOkVH4pLz6y9wCgk2gjwhfEgGxOOaeB/HHzK8WB
8ZUAnjB8U+mJHVp//PzvWv3LanAUcVoX
=XAnq
-----END PGP SIGNATURE-----

-- 
upstart-devel mailing list
upstart-devel@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/upstart-devel

Reply via email to