Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to send commands to built-in shell of running systemd server #585

Open
gofastlily opened this issue Dec 14, 2024 · 0 comments
Open

Comments

@gofastlily
Copy link

Describe the bug

When running newserv as a systemd service, I am seemingly unable to pass input to the built-in shell when leveraging a systemd socket.

The socket properly accepts the string, but no corresponding output is in the logs.

To reproduce

  1. Start FIFO socket via systemd
  2. Start newserv via systemd
  3. Send a command to the FIFO socket (echo "help" > /run/newserv.stdin)
  4. Check journalctl for log output (or lack thereof in this case)

Game version(s) (choose one or more of the following):

This is for newserv itself, not the clients

Server log output

Truncated log output showing no help command output.

....
Dec 14 15:29:47 gameserver newserv[2046]: I 2046 2024-12-14 15:29:47 - [Config] Starting IP/PPP stack simulator
Dec 14 15:29:47 gameserver newserv[2046]: I 2046 2024-12-14 15:29:47 - [IPStackSimulator] Listening on Unix socket /tmp/dolphin-tap on fd 24 as T-IPS-/tmp/dolphin-tap
Dec 14 15:29:47 gameserver newserv[2046]: I 2046 2024-12-14 15:29:47 - [IPStackSimulator] Listening on TCP interface 0.0.0.0:5059 on fd 25 as T-IPS-5059
Dec 14 15:29:47 gameserver newserv[2046]: I 2046 2024-12-14 15:29:47 - [IPStackSimulator] Listening on Unix socket /tmp/dolphin-modem-tap on fd 26 as T-PPPST-/tmp/dolphin-modem-tap
Dec 14 15:29:47 gameserver newserv[2046]: I 2046 2024-12-14 15:29:47 - [IPStackSimulator] Listening on TCP interface 0.0.0.0:5058 on fd 27 as T-PPPST-5058
Dec 14 15:29:47 gameserver newserv[2046]: I 2046 2024-12-14 15:29:47 - [IPStackSimulator] Listening on TCP interface 0.0.0.0:5057 on fd 28 as T-PPPSR-5057
Dec 14 15:29:47 gameserver newserv[2046]: I 2046 2024-12-14 15:29:47 - [Config] Note: The Devolution phone numbers for T-PPPSR-5057 are 11458972881857 (local) and 175207663997889 (external)
Dec 14 15:29:47 gameserver newserv[2046]: I 2046 2024-12-14 15:29:47 - [Config] Enabling signal watcher
Dec 14 15:29:47 gameserver newserv[2046]: I 2046 2024-12-14 15:29:47 - [Config] Ready

Additional context

systemd files

/etc/systemd/system/newserv.service

[Unit]
Description="Phantasy Star Online 1&2 Server via Newserv"
After=network.service

[Service]
ExecStart=/newserv/newserv/newserv
User=newserv
Group=newserv
WorkingDirectory=/newserv/newserv
StandardInput=socket
StandardOutput=journal
StandardError=journal

[Install]
WantedBy=multi-user.target

/etc/systemd/system/newserv.socket

[Unit]
Description="Newserv Socket"

[Socket]
ListenFIFO=%t/newserv.stdin
Service=newserv.service

Directory Structure

Expand to view
$ tree -L 2 /newserv/
/newserv/
├── newserv
│   ├── CMakeCache.txt
│   ├── CMakeFiles
│   ├── cmake_install.cmake
│   ├── CMakeLists.txt
│   ├── CTestTestfile.cmake
│   ├── Dockerfile
│   ├── LICENSE
│   ├── Makefile
│   ├── newserv
│   ├── notes
│   ├── patch_flycast_memory.py
│   ├── README.md
│   ├── src
│   ├── static
│   ├── system
│   ├── tests
│   └── TODO.md
└── phosg
    ├── ArgumentsTest
    ├── bindiff
    ├── CMakeCache.txt
    ├── CMakeFiles
    ├── cmake_install.cmake
    ├── CMakeLists.txt
    ├── CTestTestfile.cmake
    ├── EncodingTest
    ├── FilesystemTest
    ├── HashTest
    ├── ImageTest
    ├── install_manifest.txt
    ├── jsonformat
    ├── JSONTest
    ├── KDTreeTest
    ├── libphosg.a
    ├── LRUMapTest
    ├── LRUSetTest
    ├── Makefile
    ├── parse-data
    ├── phosgConfig.cmake
    ├── phosgConfig.cmake.in
    ├── phosgConfigVersion.cmake
    ├── phosg-png-conv
    ├── ProcessTest
    ├── README
    ├── reference
    ├── src
    ├── StringsTest
    ├── Testing
    ├── TimeTest
    ├── ToolsTest
    └── UnitTestTest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant