lxinitd handbook


lxinitd, lxmenu, and rosh share the same litesh syntax.

Basic Syntax

litesh scripts contain one command per line with arguments.

Here's an example from an lxc container /etc/init.d/rcS.


/sbin/mount -a
/sbin/ip addr add dev eth0
/sbin/ip route add default via
# start the process

Blank lines are ignored, lines that start with # are comments.

Each line is executed as a subprocess, except limited builtins.

Commands are executed with execv() so they repect $PATH and require absolute paths or ./.


The shebang (#!/bin/rosh) is required, even if started with /bin/rosh script

The shebang does not accept arguments or switches.

Textual content

The following rules apply to the content of scripts

  • max 2048 line length
  • max 10 arguments to a command
  • ascii 7bit only, no tabs, no invisible chars apart from space ' ' and \n
  • no \0 characters
  • no utf-8


\n exclusivly splits commands, use of \r is an error.

ONE space character (ascii 20) exclusivly splits args.

The double quote character " is used to wrap strings with spaces. To print quote or slash use standard C string escaping \\ and \".


builtins are commands that can be executed without ./


The builtins available are dependent on the context.

by teknopaul