Re: /dev/stderr gets unlinked 8]

Stefan Seyfried
2006-03-15T13:00:17Z

On Tue, Mar 14, 2006 at 03:35:57PM +0200, Denis Vlasenko wrote:

> Mysql people are strange. For example, their daemon does not want to die
> on SIGTERM, this makes it harder to run it under daemontools.

Well, daemontools are equally strange ;-))

> Also it drops privileges BEFORE it opens logfiles (--log=xxx).
> I cannot get it to log stuff on stderr:
>
> echo "* Starting mysqld"
> env - \
> setuidgid root \
> mysqld \
> --defaults-file="$PWD/my.cnf" \
> --user="$user" \
> --datadir="$var/data" \
> --tmpdir="$var/tmp" \
> --socket="$PWD/mysql.socket" \
> --pid-file="$PWD/mysql.pid" \
> --skip-name-resolve \
> --skip-innodb \
> --skip-ndbcluster \
> --skip-networking \
> --log=/proc/self/fd/2 \
> --log-slow-queries=/proc/self/fd/2 \
>
> Those last two options don't work:
>
> mysqld: File '/proc/self/fd/2' not found (Errcode: 13)

any good daemon closes stdout, stderr, stdin and does chdir(/) on startup.
msqld might do so as well.
--
Stefan Seyfried \ "I didn't want to write for pay. I
QA / R&D Team Mobile Devices \ wanted to be paid for what I write."
SUSE LINUX Products GmbH, Nürnberg \ -- Leonard Cohen