# bajia init.rc - example configuration for an embedded/VM system. # # constructs: # service NAME /path/to/exe [args...] # user = ... | group = ... | class = ... | respawn = ... | crash-threshold = ... # crash-window = ... | setenv = ... | cwd = ... | seclabel = ... # logfile = ... | depends = ... # oneshot | disabled | console (flag options, no value) # # on TRIGGER # start NAME | stop NAME | restart NAME # exec /cmd args... (run synchronously, wait to finish) # mkdir PATH [mode] # chmod PATH mode # chown PATH uid gid # setenv K V # write PATH CONTENT # symlink TARGET LINK # mount SOURCE TARGET FSTYPE # setprop KEY VALUE | getprop KEY # log message... # # standard trigger sequence run at boot: early-init, init, boot. # property:= actions fire when `setprop KEY VALUE` runs; # service-started: is on the roadmap. on early-init mount proc /proc proc mount sysfs /sys sysfs mount devtmpfs /dev devtmpfs mkdir /dev/pts 0755 mount devpts /dev/pts devpts mkdir /run 0755 mount tmpfs /run tmpfs on init exec /sbin/modprobe virtio_rng write /proc/sys/kernel/hostname bajia setprop config.ready 1 log **** bajia init on-line **** on property:config.ready=1 log configuration is ready on boot start console start watchdog # the console service: bind stdio to /dev/console, always respawn. service console /sbin/getty -L ttyS0 115200 vt100 class = core console user = root # a long-lived example daemon. respawning is the default (always). # logfile captures its stdout+stderr (parent dir /run exists via early-init). service watchdog /usr/sbin/watchdog class = core respawn = always logfile = /run/watchdog.log # a one-shot job: runs once, exits, never respawns. service boot-logo /usr/bin/show-boot-logo class = late oneshot