diff --git a/extras/startup/unrealircd.service b/extras/startup/unrealircd.service new file mode 100644 index 000000000..acac937ca --- /dev/null +++ b/extras/startup/unrealircd.service @@ -0,0 +1,41 @@ +# Systemd service for UnrealIRCd +# To use this: +# 1) Adjust user/group/paths under [Service] if needed. +# 2) Then run the following commands as root: +# cp -av unrealircd.service /etc/systemd/system/ +# systemctl daemon-reload +# systemctl enable unrealircd.service +# systemctl start unrealircd.service + +[Unit] +Description=UnrealIRCd +Documentation=https://www.unrealircd.org/ +Description=UnrealIRCd IRC Server +After=network-online.target +Wants=network-online.target + +[Service] +# If needed, change 'ircd' to your unrealircd user and adjust paths: +User=ircd +Group=ircd +ExecStart=/home/ircd/unrealircd/bin/unrealircd -F + +# These settings should be fine for everyone +Type=simple +Restart=on-failure +RestartSec=5s +LimitNOFILE=65536 +ExecReload=/bin/kill -HUP $MAINPID +ExecStop=/bin/kill -TERM $MAINPID +NoNewPrivileges=true +PrivateTmp=true +ProtectKernelTunables=true +ProtectKernelModules=true +ProtectControlGroups=true +LockPersonality=true +MemoryDenyWriteExecute=true +RestrictRealtime=true +ProtectSystem=strict + +[Install] +WantedBy=default.target diff --git a/extras/startup/unrealircd_user.service b/extras/startup/unrealircd_user.service new file mode 100644 index 000000000..ccbb0a5d1 --- /dev/null +++ b/extras/startup/unrealircd_user.service @@ -0,0 +1,37 @@ +# Systemd service for UnrealIRCd (user service) +# +# This is the USER service. You can use this if you don't have root +# on the machine (otherwise, people usually use the other +# unrealircd.service system unit instead). +# +# To install: +# 1) Adjust the ExecStart= line below, if your unrealircd isn't +# installed in ~/unrealircd/ +# 2) Then run the following commands (as a regular user): +# loginctl enable-linger +# mkdir -p ~/.config/systemd/user +# cp unrealircd_user.service ~/.config/systemd/user/unrealircd.service +# systemctl --user daemon-reload +# systemctl --user enable unrealircd.service +# systemctl --user start unrealircd.service + +[Unit] +Description=UnrealIRCd +Documentation=https://www.unrealircd.org/ +Description=UnrealIRCd IRC Server (user service) +After=network-online.target +Wants=network-online.target + +[Service] +# Adjust this if unrealircd is installed somewhere else: +ExecStart=%h/unrealircd/bin/unrealircd -F + +Type=simple +Restart=on-failure +RestartSec=5s +LimitNOFILE=65536 +ExecReload=/bin/kill -HUP $MAINPID +ExecStop=/bin/kill -TERM $MAINPID + +[Install] +WantedBy=default.target