
kyle-qmail at memoryhole
Nov 17, 2009, 11:32 AM
Post #2 of 2
(907 views)
Permalink
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On Wednesday, November 18 at 04:48 AM, quoth Philip Rhoades: >exec /usr/local/bin/softlimit -m 32000000 \ > /usr/local/bin/tcpserver -v -R -H -l "$LOCAL" \ > -x /etc/tcp.smtp.cdb -c "$MAXSMTPD" \ > -u "$QMAILDUID" -g "$NOFILESGID" 0 smtp \ > /usr/local/bin/greylite \ > /var/qmail/bin/qmail-smtpd 2> /var/log/greylite.log > >- when tcpserver processes the prog arguments - in this case the >greylite prog - does how greylite exits determine if the next program, >in this case qmail-smtpd, is run? The way this works is a process often referred to as "exec chaining". In essence, tcpserver looks at all its arguments, and runs the following command: /usr/local/bin/greylite /var/qmail/bin/qmail-smtpd In other words, it runs one program with one argument. That's all it ever does (well, okay, some people make it pass more arguments). Thus, tcpserver does nothing complex, and makes no decisions at all. Then greylite runs, makes its decision, and then (based on that decision) executes the program listed in ITS arguments (or not, depending on what greylite decided to do). This works very similar to the way sudo works. For example, consider the following command: sudo bash -c "echo foo" Your question is akin to asking "how does sudo know when to run echo?". The answer, of course, is that it doesn't, because it doesn't need to. Does that make sense? ~Kyle - -- The sacred rights of mankind are not to be rummaged for, among old parchments, or musty records. They are written, as with a sun beam in the whole volume of human nature, by the hand of the divinity itself; and can never be erased or obscured by mortal power. -- Alexander Hamilton, 1775 -----BEGIN PGP SIGNATURE----- Comment: Thank you for using encryption! iQIcBAEBCAAGBQJLAvpCAAoJECuveozR/AWe7nUP/RUgxS0hZ8F9TKuZVnpcXa8Z YY3Gs23SmfB0E9i3R117B7+pgycN3C6WGwhlfKOC3xGSKJlffNC+PD79cn3oC/a0 J16kPPTY2sT51jd2fB2GsP49Jmwmu4AWOra9ebZJULV35JiEa7531vV7C92F9FxS uxUBJLRx4VqxFsg6lb1KKe7u8NPc0KhPSj47hvshT3RST1R3oOhCl/tgghEtf0Ma IQah5ZOz6v5lBFAelnngR2Cr5iI2HBrUs5xmZqbiP6kaR1ujGkOYiVY6S3G6kCVJ F4K2PPBiJafgOttWMcyJhsL2mJmSHZkfc24elvnd7vdrCpIfgo3M87juz0rN1LId s5liqWzIFm/o/udtg2cXPcgXHXa0mx23nEFPVNhQ0k8TsnHPqycwCO5BrSnNCTmp /t3LXvHoDGIszbYeG5NWNXoezBIsk7n6PquwzzE9kNnWbhkWEs3WFdjBhbRWUlW8 3lBApFPAOos73d1quuebrPXVBLgVGYZZKz0tYAtJWn0EOLWsc1JLP3Pzp/AekmtA eSjsTJlwXZb3UFOyxxjtZydBdcLjpYxAN3G2goxP5BUW9P2MZgrnN5f4h/waIl/p b+b8hcTgwRSiVwBaa31HhToXiahWJtuHWZ+fFd3uHTmj0hQAbTjekRu8LDllGDmk rn70foS/9k7+Kt/5MYwW =+yHq -----END PGP SIGNATURE-----
|