Commit b489542f authored by Jérome Perrin's avatar Jérome Perrin

slaprunner: improve shell

- name wrapper bash, not sh as bash behave like sh when named sh
- add -l so that bash runs as login shell and reads .bash_profile
- enable colors in profile
- output a message in profile
- remaining TODOs: a working slapos node command
parent 046b4cb7
......@@ -50,7 +50,7 @@ mode = 0644
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-runner.cfg
output = ${buildout:directory}/template-runner.cfg.in
md5sum = d1913d1e0f1f3d3b1c362979888af025
md5sum = 6d6ab000fbb9a208a98e9b68d971c571
mode = 0644
[template-runner-import-script]
......@@ -143,7 +143,7 @@ mode = 0644
[template-bash-profile]
recipe = hexagonit.recipe.download
url = ${:_profile_base_location_}/template/${:filename}
md5sum = 39dc910743c70d5120a778779a052cad
md5sum = 1c88cbca0c1e705eeb4b544ef4616097
location = ${buildout:parts-directory}/${:_buildout_section_name_}
filename = bash_profile.in
download-only = true
......
......@@ -530,11 +530,11 @@ template = inline:
--disable-ssl \
--disable-ssl-menu \
--unixdomain-only=$${:socket}:$(id -u):$(id -g):0600 \
--service "/:$(id -u):$(id -g):HOME:$${shell:wrapper}"
--service "/:$(id -u):$(id -g):HOME:$${shell:wrapper} -l"
[shell]
recipe = slapos.cookbook:shell
wrapper = $${directory:bin}/sh
wrapper = $${directory:bin}/bash
shell = ${bash:location}/bin/bash
home = $${buildout:directory}
path = $${environ:PATH}:/usr/bin:/bin/:${nano:location}/bin:${vim:location}/bin:${screen:location}/bin:${git:location}/bin:${tig:location}/bin
......
......@@ -4,5 +4,38 @@
cd {{ workdir }}
export PATH={{- path }}
export PS1="\w $ "
export LANG="en_GB.UTF-8"
export PS1="$ "
if [ -f "$HOME/.bashrc" ] ; then
source $HOME/.bashrc
fi
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
# enable color support
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
fi
# some more ls aliases
alias ll='ls -l'
alias la='ls -A'
alias l='ls -CF'
echo "Welcome to SlapOS slaprunner shell"
echo
# TODO: how to run slapos ?
#echo "You can use the following slapos CLI commands:"
#echo "slapos node software"
#echo "slapos node instance"
#echo "slapos request"
#echo ""
# XXX for now we can use:
#echo ~/bin/supervisorctl -c ~/etc/supervisorctl.conf
#echo ~/bin/supervisorctl -c ~/srv/runner/instance/etc/supervisorctl.conf
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment