bajia/etc/init.rc

56 lines
1.6 KiB
Text
Raw Normal View History

2026-08-27 19:08:08 +01:00
# bajia init.rc - example configuration for an embedded/VM system.
#
# constructs:
# service NAME /path/to/exe [args...]
2026-08-27 22:50:44 +01:00
# user = ... | group = ... | class = ... | respawn = ... | crash-threshold = ...
# crash-window = ... | setenv = ... | cwd = ... | seclabel = ...
# oneshot | disabled | console (flag options, no value)
2026-08-27 19:08:08 +01:00
#
# 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
# log message...
#
# standard trigger sequence run at boot: early-init, init, boot.
# future: property:<key>=<value>, service-started:<name>.
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
log **** bajia init on-line ****
on boot
start console
start watchdog
# the console service: bind stdio to /dev/console, always respawn.
service console /sbin/getty -L ttyS0 115200 vt100
2026-08-27 22:50:44 +01:00
class = core
2026-08-27 19:08:08 +01:00
console
2026-08-27 22:50:44 +01:00
user = root
2026-08-27 19:08:08 +01:00
# a long-lived example daemon. respawning is the default (always).
service watchdog /usr/sbin/watchdog
2026-08-27 22:50:44 +01:00
class = core
respawn = always
2026-08-27 19:08:08 +01:00
# a one-shot job: runs once, exits, never respawns.
service boot-logo /usr/bin/show-boot-logo
2026-08-27 22:50:44 +01:00
class = late
2026-08-27 19:08:08 +01:00
oneshot