qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Setting new user:group with -daemonize?


From: Anthony Liguori
Subject: Re: [Qemu-devel] Setting new user:group with -daemonize?
Date: Tue, 15 Jul 2008 20:39:38 -0500
User-agent: Thunderbird 2.0.0.14 (X11/20080501)

David Barrett wrote:
Is there any way to make the qemu process change users after daemonizing?

Basically, I want to start it as root so I can have it "-redir" with a low port (80), and then change to a non-root user after daemonizing. Is there any way to do this currently?

Thankfully it opens the -redir port before forking, so it looks like a straightforward change to vc.c: basically adding a call to "setuid()" and "setgid()" after the call to "chdir()" on line 8711.

I'd update the -daemonize syntax as follows:

    -daemonize [user[:group]]

Is there any interest in such a patch?

If you introduced two new options to specify the user and the group. Also, I would be interested in a chroot option too :-)

-david

PS: Why does it fork twice?

It makes sure QEMU is an orphan process (it's parent is pid 1). It's a pretty typical thing to do when daemonizing.

Regards,

Anthony Liguori








reply via email to

[Prev in Thread] Current Thread [Next in Thread]