From ce4316d15fdc1f46f888bbf01d59cbd34d4a54e4 Mon Sep 17 00:00:00 2001 From: Gamerboy59 Date: Tue, 10 Sep 2024 16:40:00 +0200 Subject: [PATCH] Optimize rpxy.service to use more systemd features ...insted of manually managing them. --- .build/rpxy.service | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/.build/rpxy.service b/.build/rpxy.service index 606384b..49d4379 100644 --- a/.build/rpxy.service +++ b/.build/rpxy.service @@ -1,12 +1,23 @@ [Unit] -Description=rpxy Service +Description=rpxy system service +Documentation=https://github.com/junkurihara/rust-rpxy After=network.target - +Wants=network-online.target + [Service] +Type=simple ExecStart=/usr/local/bin/rpxy-start.sh -Restart=always +Restart=on-failure +RestartSec=5 User=rpxy +Group=rpxy AmbientCapabilities=CAP_NET_BIND_SERVICE - +NoNewPrivileges=true +PrivateTmp=true +ProtectSystem=full +ProtectHome=true +RuntimeDirectory=rpxy +RuntimeDirectoryMode=0750 + [Install] WantedBy=multi-user.target