2020-04-30 14:01:05 +02:00
|
|
|
#!/sbin/openrc-run
|
2022-01-15 15:14:32 +01:00
|
|
|
# Copyright 2020-2022 Gentoo Authors
|
2020-04-30 14:01:05 +02:00
|
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
|
|
|
|
|
|
name="factorio daemon"
|
|
|
|
description="2D infinite game"
|
|
|
|
command="${FACTORIO_PATH}/bin/x64/factorio"
|
2020-04-30 14:35:23 +02:00
|
|
|
command_args="${FACTORIO_OPTS}"
|
2022-01-15 15:14:32 +01:00
|
|
|
retry=15
|
2020-04-30 14:01:05 +02:00
|
|
|
|
|
|
|
command_background=1
|
|
|
|
directory="${FACTORIO_PATH}"
|
|
|
|
pidfile="/run/${RC_SVCNAME}.pid"
|
|
|
|
|
|
|
|
command_user="${FACTORIO_USER:-root}"
|
|
|
|
command_group="${FACTORIO_GROUP:-root}"
|
|
|
|
|
|
|
|
depend() {
|
|
|
|
need net
|
|
|
|
}
|
|
|
|
|
|
|
|
start_pre() {
|
|
|
|
checkpath -d -m 0750 -o "${command_user}:${command_group}" \
|
|
|
|
"${directory}"
|
|
|
|
}
|