arkmanager / ark-server-tools

Set of server tools used to manage ARK: Survival Evolved servers on Linux
MIT License
684 stars 144 forks source link

arkmanager.service systemd service fails when user has no login shell #824

Open heckmx opened 7 years ago

heckmx commented 7 years ago

Hi! I am running ark-server-tools v1.6 on a CentOS 7 server with the default main as the only ark server instance. I originally had my steamcmd user set up with '/usr/sbin/nologin' as login shell to prevent ssh access for this user etc. When I enabled arkmanager.service this led to the follwing error which looks like arkmanager somehow tried to parse the error message when trying to login as that user "This account is currently not available." as ark server instance names.

$ systemctl --failed
  UNIT                          LOAD   ACTIVE SUB    DESCRIPTION
● arkmanager@account.service    loaded failed failed Daemon to start an ark server instance
● arkmanager@available..service loaded failed failed Daemon to start an ark server instance
● arkmanager@currently.service  loaded failed failed Daemon to start an ark server instance
● arkmanager@is.service         loaded failed failed Daemon to start an ark server instance
● arkmanager@not.service        loaded failed failed Daemon to start an ark server instance
● arkmanager@This.service       loaded failed failed Daemon to start an ark server instance

I have since changed the login shell to bash and denied ssh login in the sshd config, which sort of resolves the issue, but I thought maybe this could be the cause.

su "$steamcmd_user" -c "$(printf "%q" "$0")$(printf " %q" "$@")"

Would it be possible to add a steamcmd_user_shellexec variable to arkmanager.cfg where I could specify a path to the desired shell and use something like this instead?

su "$steamcmd_user" -s "$steamcmd_user_shellexec" -c "$(printf "%q" "$0")$(printf " %q" "$@")"
klightspeed commented 7 years ago

4ec1152 adds a steamcmd_user_shellexec setting, which if not set defaults to $BASH (the interpreter used to execute the script).