From 486b06b4125c00dd6ffce079432022a11930ce01 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Fri, 19 May 2017 12:39:14 +0000 Subject: Add execline-startup and execline-shell to examples/ again --- doc/execline-shell.html | 7 ++++--- doc/execline-startup.html | 5 +++-- examples/etc/env-startup/EDITOR | 1 + examples/etc/env-startup/GZIP | 1 + examples/etc/env-startup/LC_CTYPE | 1 + examples/etc/env-startup/LESS | 1 + examples/etc/env-startup/LESSCHARSET | 1 + examples/etc/env-startup/MAIL | 0 examples/etc/env-startup/PAGER | 1 + examples/etc/env-startup/PATH | 1 + examples/etc/env-startup/SHELL | 1 + examples/etc/env-startup/VISUAL | 1 + examples/etc/execline-shell | 18 ++++++++++++++++++ examples/etc/execline-startup | 15 +++++++++++++++ 14 files changed, 49 insertions(+), 5 deletions(-) create mode 100644 examples/etc/env-startup/EDITOR create mode 100644 examples/etc/env-startup/GZIP create mode 100644 examples/etc/env-startup/LC_CTYPE create mode 100644 examples/etc/env-startup/LESS create mode 100644 examples/etc/env-startup/LESSCHARSET create mode 100644 examples/etc/env-startup/MAIL create mode 100644 examples/etc/env-startup/PAGER create mode 100644 examples/etc/env-startup/PATH create mode 100644 examples/etc/env-startup/SHELL create mode 100644 examples/etc/env-startup/VISUAL create mode 100755 examples/etc/execline-shell create mode 100755 examples/etc/execline-startup diff --git a/doc/execline-shell.html b/doc/execline-shell.html index b14c48d..02449c7 100644 --- a/doc/execline-shell.html +++ b/doc/execline-shell.html @@ -20,7 +20,8 @@

execline-shell executes $HOME/.execline-shell -with the arguments it is given. +if available (or /bin/sh otherwise) with the arguments +it is given.

Interface

@@ -34,7 +35,7 @@ with the arguments it is given. ${HOME}/.execline-shell $@.
  • ${HOME}/.execline-shell must be readable and executable by the user. It must exec into an interactive -shell with $@ as its argument.
  • +shell with $@ as its argument.

    Notes

    @@ -46,7 +47,7 @@ shell configuration in any language, since the ${HOME}/.execline-shell file can be any executable program. ${HOME}/.execline-shell can be seen as a portable .whateverrc file.
  • As an administrator-modifiable configuration file, execline-shell -provided in execline's etc/ subdirectory, and should be copied by +provided in execline's examples/etc/ subdirectory, and should be copied by the administrator to /etc.
  • diff --git a/doc/execline-startup.html b/doc/execline-startup.html index ccbdb56..69b3797 100644 --- a/doc/execline-startup.html +++ b/doc/execline-startup.html @@ -33,7 +33,8 @@ login initialization, then executes ${HOME}/.execline-loginshell.
  • execline-startup sets the SHELL environment variable to /etc/execline-shell. It then performs some system-specific initialization, and -transforms itself into ${HOME}/.execline-loginshell $@.
  • +transforms itself into ${HOME}/.execline-loginshell $@ +if available (and /etc/execline-shell otherwise).
  • ${HOME}/.execline-loginshell must be readable and executable by the user. It must exec into $SHELL $@.
  • @@ -46,7 +47,7 @@ executable by the user. It must exec into $SHELL $@. and modifiable. It is meant to be modified by the system administrator to perform system-specific login-time initialization.
  • As a modifiable configuration file, execline-startup is provided in execline's -etc/ subdirectory, and should be copied by the administrator +examples/etc/ subdirectory, and should be copied by the administrator to /etc.
  • execline-startup is meant to be used as a login shell. System administrators should manually add /etc/execline-startup diff --git a/examples/etc/env-startup/EDITOR b/examples/etc/env-startup/EDITOR new file mode 100644 index 0000000..7c74f87 --- /dev/null +++ b/examples/etc/env-startup/EDITOR @@ -0,0 +1 @@ +vi diff --git a/examples/etc/env-startup/GZIP b/examples/etc/env-startup/GZIP new file mode 100644 index 0000000..6514c51 --- /dev/null +++ b/examples/etc/env-startup/GZIP @@ -0,0 +1 @@ +-r9 diff --git a/examples/etc/env-startup/LC_CTYPE b/examples/etc/env-startup/LC_CTYPE new file mode 100644 index 0000000..927508f --- /dev/null +++ b/examples/etc/env-startup/LC_CTYPE @@ -0,0 +1 @@ +en_US.UTF-8 diff --git a/examples/etc/env-startup/LESS b/examples/etc/env-startup/LESS new file mode 100644 index 0000000..d963b9c --- /dev/null +++ b/examples/etc/env-startup/LESS @@ -0,0 +1 @@ +-fMqrIX -b16 -z-2 diff --git a/examples/etc/env-startup/LESSCHARSET b/examples/etc/env-startup/LESSCHARSET new file mode 100644 index 0000000..5546241 --- /dev/null +++ b/examples/etc/env-startup/LESSCHARSET @@ -0,0 +1 @@ +utf8 diff --git a/examples/etc/env-startup/MAIL b/examples/etc/env-startup/MAIL new file mode 100644 index 0000000..e69de29 diff --git a/examples/etc/env-startup/PAGER b/examples/etc/env-startup/PAGER new file mode 100644 index 0000000..c96a5ab --- /dev/null +++ b/examples/etc/env-startup/PAGER @@ -0,0 +1 @@ +less diff --git a/examples/etc/env-startup/PATH b/examples/etc/env-startup/PATH new file mode 100644 index 0000000..cbd04b7 --- /dev/null +++ b/examples/etc/env-startup/PATH @@ -0,0 +1 @@ +/usr/local/bin:/usr/bin:/bin diff --git a/examples/etc/env-startup/SHELL b/examples/etc/env-startup/SHELL new file mode 100644 index 0000000..0a59cfa --- /dev/null +++ b/examples/etc/env-startup/SHELL @@ -0,0 +1 @@ +/etc/execline-shell diff --git a/examples/etc/env-startup/VISUAL b/examples/etc/env-startup/VISUAL new file mode 100644 index 0000000..7c74f87 --- /dev/null +++ b/examples/etc/env-startup/VISUAL @@ -0,0 +1 @@ +vi diff --git a/examples/etc/execline-shell b/examples/etc/execline-shell new file mode 100755 index 0000000..ac8c141 --- /dev/null +++ b/examples/etc/execline-shell @@ -0,0 +1,18 @@ +#!/bin/execlineb -S0 + +backtick -n defaulthome +{ + if -nt + { + backtick -n defaultuser { id -un } + importas -u defaultuser defaultuser + importas -D $defaultuser USER USER + redirfd -w 2 /dev/null + homeof ${USER} + } + s6-echo / +} +importas -u defaulthome defaulthome +importas -D $defaulthome HOME HOME +tryexec { ${HOME}/.execline-shell $@ } +/bin/sh $@ diff --git a/examples/etc/execline-startup b/examples/etc/execline-startup new file mode 100755 index 0000000..4afc557 --- /dev/null +++ b/examples/etc/execline-startup @@ -0,0 +1,15 @@ +#!/bin/execlineb -S0 + +/bin/multisubstitute +{ + importas -i HOME HOME + importas -i LOGNAME LOGNAME +} +/bin/export USER ${LOGNAME} +/bin/s6-envdir /etc/env-startup +/bin/fdblock 0 +/bin/fdblock 1 +/bin/fdblock 2 + +/bin/tryexec { ${HOME}/.execline-loginshell $@ } +/etc/execline-shell $@ -- cgit v1.2.3