question for linuxgsm/root user, and custom crontab

Open
#39 14 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
docker, docker-compose, shell

Research direction

Start with the docker-compose minecraft service, its mounted /data volume, and the custom crontab commands shown in the report. Trace how the linuxgsm user and root resolve the /app/mcserver configuration, then verify whether scheduled commands run and persist after a container restart.

Written by the indexing model from the issue text.

Description

hello everyone,

i try to use custom crontab in linuxgsm user, and i find out it will restore to default if i restart container, and even before restart container, the crontab will not work as expected, like no run the command
here is the crontab

*/60 * * * * /app/mcserver update > /dev/null 2>&1
0 * * * * /app/mcserver send "kill @e[type=item]"

and then i try to set up crontab in root user like this

0 * * * * su - linuxgsm -c '/app/mcserver send "kill @e[type=item]"'

it can't run either.

when i run command alone, its show "server not running".

then i type

su - linuxgsm -c '/app/mcserver dt'

图片

seems its wrong config file path. maybe its environment problem? but i check the 'env' in linuxgsm user and root user, its the same.

here is my docker-compose

  minecraft:
    image:  gameservermanagers/gameserver:mc
    container_name: minecraft
    volumes:
      - /mnt/ssd/docker/minecraft:/data
    network_mode: host
    restart: always

any idea for it ?

Dominant language
Shell
Stars
347
Forks
26
Avg merge
8h 2m
Merged PRs (30d)
2

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

  • Ships a Dockerfile or Docker Compose file
  • No pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from GameServerManagers/docker-gameserver

All issues in GameServerManagers/docker-gameserver

Similar issues

More Shell/Bash issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.