X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=monitor-runlevelagent.init;h=4923c6d98e57b9dafa436aee71609d159e373a46;hb=a837fdf2c23d08ff99f083fa9fb04360d7323f80;hp=f22d5874063c0c3b602c31d8af70d278146690f1;hpb=acfcc9e86050d370c7c510aa94bc80ebf5961edd;p=monitor.git diff --git a/monitor-runlevelagent.init b/monitor-runlevelagent.init index f22d587..4923c6d 100644 --- a/monitor-runlevelagent.init +++ b/monitor-runlevelagent.init @@ -15,6 +15,9 @@ case "$1" in start|restart|reload) + + start_rla + ;; stop|status) exit 0 @@ -25,26 +28,8 @@ case "$1" in ;; esac -# NOTE: If user already exists, this just exists with status 9. I think it's -# ok to simply let this command check and error out. -# Parse PLC configuration -if [ -r /etc/planetlab/plc_config ] ; then - . /etc/planetlab/plc_config -else - PLC_NAME="PlanetLab" - PLC_SLICE_PREFIX="pl" - PLC_BOOT_HOST="boot.planet-lab.org" -fi - -USER="${PLC_SLICE_PREFIX}_monitor" -/usr/sbin/useradd -p "" -m $USER &> /dev/null || : - -if [ ! -d /home/$USER/.ssh ] ; then - mkdir /home/$USER/.ssh - chmod 700 /home/$USER/.ssh - chown $USER.$USER /home/$USER/.ssh -fi - -URL="http://${PLC_BOOT_HOST}/PlanetLabConf/keys.php?$USER" -curl -s "$URL" > /home/$USER/.ssh/authorized_keys -chown $USER.$USER /home/$USER/.ssh/authorized_keys +function start_rla () +{ + RLA=/usr/bin/RunlevelAgent.py + $RLA &> /var/log/rla.log & +}