mirror of
https://github.com/eliasstepanik/ark-ac-server-tools.git
synced 2026-01-22 06:38:27 +00:00
Have systemd (and upstart) run the script as the user
This commit is contained in:
parent
e560db7914
commit
fbd75687da
@ -215,7 +215,7 @@ else
|
|||||||
cp systemd/arkmanager.service "${INSTALL_ROOT}/etc/systemd/system/arkmanager.service"
|
cp systemd/arkmanager.service "${INSTALL_ROOT}/etc/systemd/system/arkmanager.service"
|
||||||
sed -i "s|=/usr/libexec/arkmanager/|=${LIBEXECDIR}/|" "${INSTALL_ROOT}/etc/systemd/system/arkmanager.service"
|
sed -i "s|=/usr/libexec/arkmanager/|=${LIBEXECDIR}/|" "${INSTALL_ROOT}/etc/systemd/system/arkmanager.service"
|
||||||
cp systemd/arkmanager@.service "${INSTALL_ROOT}/etc/systemd/system/arkmanager@.service"
|
cp systemd/arkmanager@.service "${INSTALL_ROOT}/etc/systemd/system/arkmanager@.service"
|
||||||
sed -i "s|=/usr/bin/|=${BINDIR}/|" "${INSTALL_ROOT}/etc/systemd/system/arkmanager@.service"
|
sed -i "s|=/usr/bin/|=${BINDIR}/|;s|=steam$|=${steamcmd_user}|" "${INSTALL_ROOT}/etc/systemd/system/arkmanager@.service"
|
||||||
if [ -z "${INSTALL_ROOT}" ]; then
|
if [ -z "${INSTALL_ROOT}" ]; then
|
||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
systemctl enable arkmanager.service
|
systemctl enable arkmanager.service
|
||||||
@ -243,7 +243,7 @@ else
|
|||||||
cp systemd/arkmanager.service "${INSTALL_ROOT}/etc/systemd/system/arkmanager.service"
|
cp systemd/arkmanager.service "${INSTALL_ROOT}/etc/systemd/system/arkmanager.service"
|
||||||
sed -i "s|=/usr/libexec/arkmanager/|=${LIBEXECDIR}/|" "${INSTALL_ROOT}/etc/systemd/system/arkmanager.service"
|
sed -i "s|=/usr/libexec/arkmanager/|=${LIBEXECDIR}/|" "${INSTALL_ROOT}/etc/systemd/system/arkmanager.service"
|
||||||
cp systemd/arkmanager@.service "${INSTALL_ROOT}/etc/systemd/system/arkmanager@.service"
|
cp systemd/arkmanager@.service "${INSTALL_ROOT}/etc/systemd/system/arkmanager@.service"
|
||||||
sed -i "s|=/usr/bin/|=${BINDIR}/|" "${INSTALL_ROOT}/etc/systemd/system/arkmanager@.service"
|
sed -i "s|=/usr/bin/|=${BINDIR}/|;s|=steam$|=${steamcmd_user}|" "${INSTALL_ROOT}/etc/systemd/system/arkmanager@.service"
|
||||||
if [ -z "${INSTALL_ROOT}" ]; then
|
if [ -z "${INSTALL_ROOT}" ]; then
|
||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
systemctl enable arkmanager.service
|
systemctl enable arkmanager.service
|
||||||
@ -277,7 +277,7 @@ else
|
|||||||
cp systemd/arkmanager.service "${INSTALL_ROOT}/etc/systemd/system/arkmanager.service"
|
cp systemd/arkmanager.service "${INSTALL_ROOT}/etc/systemd/system/arkmanager.service"
|
||||||
sed -i "s|=/usr/libexec/arkmanager/|=${LIBEXECDIR}/|" "${INSTALL_ROOT}/etc/systemd/system/arkmanager.service"
|
sed -i "s|=/usr/libexec/arkmanager/|=${LIBEXECDIR}/|" "${INSTALL_ROOT}/etc/systemd/system/arkmanager.service"
|
||||||
cp systemd/arkmanager@.service "${INSTALL_ROOT}/etc/systemd/system/arkmanager@.service"
|
cp systemd/arkmanager@.service "${INSTALL_ROOT}/etc/systemd/system/arkmanager@.service"
|
||||||
sed -i "s|=/usr/bin/|=${BINDIR}/|" "${INSTALL_ROOT}/etc/systemd/system/arkmanager@.service"
|
sed -i "s|=/usr/bin/|=${BINDIR}/|;s|=steam$|=${steamcmd_user}|" "${INSTALL_ROOT}/etc/systemd/system/arkmanager@.service"
|
||||||
if [ -z "${INSTALL_ROOT}" ]; then
|
if [ -z "${INSTALL_ROOT}" ]; then
|
||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
systemctl enable arkmanager.service
|
systemctl enable arkmanager.service
|
||||||
|
|||||||
@ -2,5 +2,6 @@
|
|||||||
Description=Daemon to start an ark server instance
|
Description=Daemon to start an ark server instance
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
|
User=steam
|
||||||
ExecStart=/usr/bin/arkmanager useconfig %i run
|
ExecStart=/usr/bin/arkmanager useconfig %i run
|
||||||
Type=simple
|
Type=simple
|
||||||
|
|||||||
@ -2,6 +2,8 @@ description "ARK Server Tools service"
|
|||||||
|
|
||||||
instance $service
|
instance $service
|
||||||
|
|
||||||
|
setuid steam
|
||||||
|
|
||||||
env DAEMON="/usr/bin/arkmanager"
|
env DAEMON="/usr/bin/arkmanager"
|
||||||
|
|
||||||
exec "$DAEMON" useconfig $service run
|
exec "$DAEMON" useconfig $service run
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user