Есть Minecraft сервер на CentOS 7, который при крашах рестартится systemd сервисом. Все работает как надо и проблем нет.
Конфиг серсиса лежит в /etc/systemd/system/my_minecraft_server.service
:
[Unit]
Description=my_minecraft_server
[Service]
Type=simple
WorkingDirectory=/home/my_user/my_server/
ExecStart=/home/my_user/my_server/start.sh
User=my_user
Restart=always
Sockets=my_minecraft_server.socket
StandardInput=socket
StandardOutput=journal
StandardError=journal
[Install]
WantedBy=multi-user.target
Сокет к нему лежит в = /etc/systemd/system/my_minecraft_server.socket
:
[Unit]
PartOf=my_minecraft_server.service
[Socket]
ListenFIFO=%t/my_minecraft_server.stdin
Но после переезда на CentOS 9 Stream сервис перестал работать:
$ sudo systemctl start my_minecraft_server.service
Job for my_minecraft_server.service failed because of unavailable resources or another system error.
See "systemctl status my_minecraft_server.service" and "journalctl -xeu my_minecraft_server.service" for details.
Вот вывод из systemctl status my_minecraft_server.service
:
$ systemctl status my_minecraft_server.service
× my_minecraft_server.service - my_minecraft_server
Loaded: loaded (/etc/systemd/system/my_minecraft_server.service; enabled; preset: disabled)
Active: failed (Result: resources) since Fri 2024-05-03 00:36:59 EDT; 1min 9s ago
TriggeredBy: ○ my_minecraft_server.socket
CPU: 0
May 03 00:36:59 systemd[1]: my_minecraft_server.service: Scheduled restart job, restart counter is at 5.
May 03 00:36:59 systemd[1]: Stopped my_minecraft_server.
May 03 00:36:59 systemd[1]: my_minecraft_server.service: Start request repeated too quickly.
May 03 00:36:59 systemd[1]: my_minecraft_server.service: Failed with result 'resources'.
May 03 00:36:59 systemd[1]: Failed to start my_minecraft_server.
Вот вывод из journalctl -xeu my_minecraft_server.service
:
░░ Subject: A stop job for unit my_minecraft_server.service has finished
░░ Defined-By: systemd
░░ Support: https://access.redhat.com/support
░░
░░ A stop job for unit my_minecraft_server.service has finished.
░░
░░ The job identifier is 133423 and the job result is done.
May 03 00:36:59 systemd[1]: my_minecraft_server.service: Start request repeated too quickly.
May 03 00:36:59 systemd[1]: my_minecraft_server.service: Failed with result 'resources'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: https://access.redhat.com/support
░░
░░ The unit my_minecraft_server.service has entered the 'failed' state with result 'resources'.
May 03 00:36:59 systemd[1]: Failed to start my_minecraft_server.
░░ Subject: A start job for unit my_minecraft_server.service has failed
░░ Defined-By: systemd
░░ Support: https://access.redhat.com/support
░░
░░ A start job for unit my_minecraft_server.service has finished with a failure.
░░
░░ The job identifier is 133423 and the job result is failed.
Я уже вообще без понятия в чем может быть дело. Скрипт start.sh
работает корректно, если я запускаю его вручную. Эксперимента ради оставил в start.sh
только echo "hello"
и результат тот же. Кажется я как-то не так описал сервис. В чем может быть проблема?Почему мой сервис перестал работать и как это починить?