Commit 25c75816 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 0d938638
...@@ -139,7 +139,7 @@ mode = 0644 ...@@ -139,7 +139,7 @@ mode = 0644
[template-bash-profile] [template-bash-profile]
recipe = hexagonit.recipe.download recipe = hexagonit.recipe.download
url = ${:_profile_base_location_}/template/${:filename} url = ${:_profile_base_location_}/template/${:filename}
md5sum = 533bc62491639cf2d9e612520de5defa md5sum = 240fa8f68d83d5b8d35f08dd9a485cd7
location = ${buildout:parts-directory}/${:_buildout_section_name_} location = ${buildout:parts-directory}/${:_buildout_section_name_}
filename = bash_profile.in filename = bash_profile.in
download-only = true download-only = true
......
...@@ -530,7 +530,7 @@ template = inline: ...@@ -530,7 +530,7 @@ template = inline:
--disable-ssl \ --disable-ssl \
--disable-ssl-menu \ --disable-ssl-menu \
--unixdomain-only=$${:socket}:$(id -u):$(id -g):0600 \ --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] [shell]
recipe = slapos.cookbook:shell recipe = slapos.cookbook:shell
......
...@@ -4,6 +4,38 @@ ...@@ -4,6 +4,38 @@
cd {{ workdir }} cd {{ workdir }}
export PATH={{- path }} export PATH={{- path }}
export PS1="\w $ " export PS1="$ "
export LANG="en_GB.UTF-8" # XXX jerome - is it good idea ?
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 webrunner"
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