Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(238)

Side by Side Diff: session_manager.sh

Issue 479011: Scripts to use chrome as a login manager (Closed)
Patch Set: revert to /dev/urandom Created 11 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « debian/rules ('k') | start_login.sh » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/bin/sh 1 #!/bin/sh
2 2
3 # Copyright (c) 2009 The Chromium OS Authors. All rights reserved. 3 # Copyright (c) 2009 The Chromium OS Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 XAUTH_FILE="/var/run/chromelogin.auth" 7 XAUTH_FILE="/var/run/chromelogin.auth"
8 SERVER_READY= 8 SERVER_READY=
9 9
10 user1_handler () { 10 user1_handler () {
11 echo "received SIGUSR1!" 11 echo "received SIGUSR1!"
12 SERVER_READY=y 12 SERVER_READY=y
13 } 13 }
14 14
15 trap user1_handler USR1 15 trap user1_handler USR1
16 MCOOKIE=$(head -c 8 /dev/random | openssl md5) 16 MCOOKIE=$(head -c 8 /dev/urandom | openssl md5) # speed this up?
17 /usr/bin/xauth -q -f ${XAUTH_FILE} add :0 . ${MCOOKIE} 17 /usr/bin/xauth -q -f ${XAUTH_FILE} add :0 . ${MCOOKIE}
18 18
19 /etc/init.d/xstart.sh ${XAUTH_FILE} $$& 19 /etc/init.d/xstart.sh ${XAUTH_FILE} &
20 20
21 while [ -z ${SERVER_READY} ]; do 21 while [ -z ${SERVER_READY} ]; do
22 sleep .1 22 sleep .1
23 done 23 done
24 24
25 # TODO: move this to a more appropriate place, once we actually start 25 export USER=chronos
26 # doing login for real in this code pathway. 26 export DATA_DIR=/home/${USER}
27 /sbin/initctl emit login-prompt-ready & 27 mkdir -p ${DATA_DIR} && chown ${USER}:admin ${DATA_DIR}
28 su chronos -c "/etc/init.d/start_login.sh ${MCOOKIE}" 28 exec su ${USER} -c "/etc/init.d/start_login.sh ${MCOOKIE}"
29 29
OLDNEW
« no previous file with comments | « debian/rules ('k') | start_login.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698