[26443] in Source-Commits
Re: /svn/athena r25560 r25561 - trunk/debathena/debathena/kiosk
daemon@ATHENA.MIT.EDU (Benjamin Kaduk)
Tue Jun 5 21:51:02 2012
Date: Tue, 5 Jun 2012 21:50:57 -0400 (EDT)
From: Benjamin Kaduk <kaduk@MIT.EDU>
To: Jonathan D Reed <jdreed@MIT.EDU>
cc: source-commits@MIT.EDU
In-Reply-To: <201206041615.q54GFhcZ018440@drugstore.mit.edu>
Message-ID: <alpine.GSO.1.10.1206052150110.18441@multics.mit.edu>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
I almost asked about that, too!
ACK 25560 and 25561.
(Was that a 'svn move' with two 'svn commit's?)
-Ben
On Mon, 4 Jun 2012, Jonathan D Reed wrote:
> Author: jdreed
> Date: 2012-06-04 12:15:42 -0400 (Mon, 04 Jun 2012)
> New Revision: 25561
>
> Added:
> trunk/debathena/debathena/kiosk/lightdm-launch-kiosk
> Log:
> Move lightdm-launch-kiosk to correct location in source tree
>
> Copied: trunk/debathena/debathena/kiosk/lightdm-launch-kiosk (from rev 25559, trunk/debathena/debathena/kiosk/debian/lightdm-launch-kiosk)
> ===================================================================
> --- trunk/debathena/debathena/kiosk/lightdm-launch-kiosk (rev 0)
> +++ trunk/debathena/debathena/kiosk/lightdm-launch-kiosk 2012-06-04 16:15:42 UTC (rev 25561)
> @@ -0,0 +1,32 @@
> +#!/usr/bin/python -Wall
> +
> +import os
> +
> +LAUNCH_COMMAND = "/usr/lib/debathena-kiosk/launch-kiosk"
> +
> +
> +def main():
> + pid = os.fork()
> + if pid == 0:
> + # Start a new session.
> + os.setsid();
> + # Fork another child to launch the command.
> + pid = os.fork()
> + if pid == 0:
> + # Here in the second child, exec the command.
> + try:
> + os.execlp("sudo", "sudo", "-n", LAUNCH_COMMAND)
> + except OSError, e:
> + print "error: Could not run %s as root: %s" % (LAUNCH_COMMAND, e.strerror)
> + os._exit(255)
> + else:
> + # The first child exits immediately.
> + os._exit(0)
> + else:
> + # Here in the parent: wait for the first child to exit.
> + (pid, status) = os.waitpid(pid, 0)
> + if status != 0:
> + print "error launching command, status %d" % status
> +
> +if __name__ == '__main__':
> + main()
>
>