A simple wrapper program to expose stdio over unix sockets
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
Arlo (Hyena) 53f712adc1 Clean a couple loops il y a 1 mois
src Clean a couple loops il y a 1 mois
.gitignore Initial commit il y a 1 mois
Cargo.lock 0.2.0-alpha.1 il y a 1 mois
Cargo.toml 0.2.0-alpha.1 il y a 1 mois
LICENSE Initial commit il y a 1 mois
README.md Add sudo -u to readme il y a 1 mois

README.md

Wrapped

A simple wrapper around any user-interactive program to expose stdio over unix sockets

Why would I want this?

Say you were trying to host a minecraft server, and you want to be able to log into the server’s console, but you also want to manage your server with SystemD unit files. Ordinarily this isn’t possible, since running a minecraft server as a system service means you can’t access it’s console. This program helps you get around that.

Example

Say we want to start our minecraft server in a unit file

[Unit]
Description=Our minecraft server
After=network.target

[Service]
Type=simple
User=minecraft
WorkingDirectory=/home/minecraft
ExecStart=/usr/bin/java -Xmx1024M -Xms1024M -jar minecraft_server.1.14.4.jar nogui
TimeoutSec=15
Restart=always

[Install]
WantedBy=multi-user.target

We can make this interactable like so

[Unit]
Description=Our minecraft server
After=network.target

[Service]
Type=simple
User=minecraft
WorkingDirectory=/home/minecraft
ExecStart=/usr/local/bin/wrapped -s /tmp/uds -- /usr/bin/java -Xmx1024M -Xms1024M -jar minecraft_server.1.14.4.jar nogui
TimeoutSec=15
Restart=always

[Install]
WantedBy=multi-user.target

And now we can log into our minecraft server like this:

$ sudo -u minecraft wrapped -s /tmp/uds

Simple!

License

This project is licensed under the Cooperative Public License. See the provided LICENSE file for more information.