3 # monitor Enables the monitor account by setting up the ssh key from the enabled PLC.
5 # Load before nm, vcached, and vservers, vserver-reference
7 # description: Fetch monitor ssh key to enable access to machine via monitor immediately.
9 # Stephen Soltesz <soltesz@cs.princeton.edu>
10 # Copyright (C) 2008 The Trustees of Princeton University
22 echo $"Usage: $0 {start|stop|restart|status}"
27 # NOTE: If user already exists, this just exists with status 9. I think it's
28 # ok to simply let this command check and error out.
29 # Parse PLC configuration
30 if [ -r /etc/planetlab/plc_config ] ; then
31 . /etc/planetlab/plc_config
35 PLC_BOOT_HOST="boot.planet-lab.org"
38 USER="${PLC_SLICE_PREFIX}_monitor"
39 /usr/sbin/useradd -p "" -m $USER &> /dev/null || :
41 if [ ! -d /home/$USER/.ssh ] ; then
42 mkdir /home/$USER/.ssh
43 chmod 700 /home/$USER/.ssh
44 chown $USER.$USER /home/$USER/.ssh
47 URL="http://${PLC_BOOT_HOST}/PlanetLabConf/keys.php?$USER"
48 curl -s "$URL" > /home/$USER/.ssh/authorized_keys
49 chown $USER.$USER /home/$USER/.ssh/authorized_keys