2019-09-23 14:35:17 +02:00
|
|
|
#!/sbin/openrc-run
|
|
|
|
|
|
|
|
# Init-Skript for log2ram
|
|
|
|
# This skript is designed to work on Gentoo Linux with OpenRC
|
|
|
|
|
2019-09-24 13:45:36 +02:00
|
|
|
description="Store logfiles in RAM to minimize writes to disk."
|
2019-09-23 14:35:17 +02:00
|
|
|
|
2019-09-26 09:53:27 +02:00
|
|
|
# Command is available when the service is started
|
|
|
|
extra_started_commands="write"
|
|
|
|
|
2019-09-23 14:35:17 +02:00
|
|
|
depend() {
|
|
|
|
need localmount
|
|
|
|
before logger
|
|
|
|
}
|
|
|
|
|
|
|
|
start() {
|
|
|
|
ebegin "Starting Log2Ram"
|
|
|
|
/usr/local/bin/log2ram start
|
|
|
|
eend $?
|
|
|
|
}
|
|
|
|
|
|
|
|
stop() {
|
|
|
|
ebegin "Stopping Log2Ram"
|
|
|
|
/usr/local/bin/log2ram stop
|
|
|
|
eend $?
|
|
|
|
}
|
|
|
|
|
2019-09-26 09:53:27 +02:00
|
|
|
write() {
|
2019-09-23 14:35:17 +02:00
|
|
|
ebegin "Syncing logs to disk"
|
|
|
|
/usr/local/bin/log2ram write
|
|
|
|
eend $?
|
|
|
|
}
|