Skip to content

Instantly share code, notes, and snippets.

@TehPeGaSuS
Last active July 19, 2025 21:26
Show Gist options
  • Select an option

  • Save TehPeGaSuS/ebcb3ef2400cc91b14eb63cfeb2c2994 to your computer and use it in GitHub Desktop.

Select an option

Save TehPeGaSuS/ebcb3ef2400cc91b14eb63cfeb2c2994 to your computer and use it in GitHub Desktop.
UnrealIRCd Systemd Service Units
#---------------------------------------------#
# Systemd Unit for UnrealIRCd #
# #
# NOTE: This was tested on Ubuntu 20.04+ #
#---------------------------------------------#------------------------------------------#
# INSTRUCTIONS #
# #
# Put this systemd unit inside the '/etc/systemd/system' folder and name it: #
# unrealircd.service #
# #
# Make the system aware of the service unit with the following command: #
# systemctl daemon-reload #
# #
#----------------------------------------------------------------------------------------#
# SYSTEMD COMMANDS TO MANAGE UNREALIRCD #
# #
# To start Unrealircd: systemctl start unrealircd.service #
# #
# To stop Unrealircd: systemctl stop unrealircd.service #
# #
# To reload Unrealircd: systemctl reload unrealircd.service #
# #
# To enable Unrealircd to start on boot: systemctl enable unrealircd.service #
# #
# To disable Unrealircd from starting on boot: systemctl disable unrealircd.service #
#----------------------------------------------------------------------------------------#
[Unit]
Description=UnrealIRCd IRC daemon
[Service]
#-------------------------------------------------------#
# Full path to UnrealIRCd installation directory. #
# This should be something like '/home/ircd/unrealircd' #
#-------------------------------------------------------#
WorkingDirectory=/home/ircd/unrealircd
#------------------------------------------------------------------------#
# Full command to start UnrealIRCd #
# This should be something like '/home/ircd/unrealircd/unrealircd start' #
#------------------------------------------------------------------------#
ExecStart=/home/ircd/unrealircd/unrealircd start
#-------------------------------------------------------------------------#
# Full command to rehash UnrealIRCd #
# This should be something like '/home/ircd/unrealircd/unrealircd rehash' #
#-------------------------------------------------------------------------#
ExecReload=/home/ircd/unrealircd/unrealircd rehash
#-------------------------------------#
# Location of the UnrealIRCd PID file #
#-------------------------------------#
PIDFile=/home/ircd/unrealircd/data/unrealircd.pid
#------------------------------------------------------------------#
# User and group where UnrealIRCd is currenly installed #
# When installed from source, usually, user and group are the same #
#------------------------------------------------------------------#
User=ircd
#
Group=ircd
#---------------------------#
# Recommended type: forking #
#---------------------------#
Type=forking
#-----------------------------------------#
# Restart policy. Recommended: on-failure #
#-----------------------------------------#
Restart=on-failure
[Install]
WantedBy=multi-user.target
#---------------------------------------------#
# User Systemd Unit for UnrealIRCd #
# #
# NOTE: This was tested on Ubuntu 20.04+ #
#---------------------------------------------#----------------------------------------------------#
# INSTRUCTIONS #
# #
# Enable lingering for your user with the following command: #
# loginctl enable-linger #
# #
# Create the user systemd folder with the following command: #
# mkdir -p .config/systemd/user #
# #
# Put this systemd user unit inside the created folder and name it: #
# unrealircd_user.service #
# #
# Make the system aware of the service unit with the following command: #
# systemctl --user daemon-reload #
# #
#--------------------------------------------------------------------------------------------------#
# SYSTEMD COMMANDS TO MANAGE UNREALIRCD #
# #
# To start UnrealIRCd: systemctl --user start unrealircd_user.service #
# #
# To stop UnrealIRCd: systemctl --user stop unrealircd_user.service #
# #
# To reload UnrealIRCd: systemctl --user reload unrealircd_user.service #
# #
# To enable UnrealIRCd to start on boot: systemctl --user enable unrealircd_user.service #
# #
# To disable UnrealIRCd from starting on boot: systemctl --user disable unrealircd_user.service #
#--------------------------------------------------------------------------------------------------#
[Unit]
Description=UnrealIRCd IRC daemon
[Service]
#-------------------------------------------------------#
# Full path to UnrealIRCd installation directory. #
# This should be something like '/home/ircd/unrealircd' #
#-------------------------------------------------------#
WorkingDirectory=/home/ircd/unrealircd
#------------------------------------------------------------------------#
# Full command to start UnrealIRCd #
# This should be something like '/home/ircd/unrealircd/unrealircd start' #
#------------------------------------------------------------------------#
ExecStart=/home/ircd/unrealircd/unrealircd start
#-------------------------------------------------------------------------#
# Full command to rehash UnrealIRCd #
# This should be something like '/home/ircd/unrealircd/unrealircd rehash' #
#-------------------------------------------------------------------------#
ExecReload=/home/ircd/unrealircd/unrealircd rehash
#-------------------------------------#
# Location of the UnrealIRCd PID file #
#-------------------------------------#
PIDFile=/home/ircd/unrealircd/data/unrealircd.pid
#---------------------------#
# Recommended type: forking #
#---------------------------#
Type=forking
#-----------------------------------------#
# Restart policy. Recommended: on-failure #
#-----------------------------------------#
Restart=on-failure
[Install]
WantedBy=default.target
@tydel
Copy link

tydel commented Jul 18, 2025

FYI, on Debian at least, the user unit file doesn't work well without the PIDFile directive pointing to the PID file for the ircd.

@TehPeGaSuS
Copy link
Author

TehPeGaSuS commented Jul 19, 2025

FYI, on Debian at least, the user unit file doesn't work well without the PIDFile directive pointing to the PID file for the ircd.

I can't test on Debian but the /home/$USER/unrealircd/unrealircd rehash should work without issues, though.

I'll test it out when I have a chance, if I can.

As I pointed out on the top of each unit, they were only tested on Ubuntu 20.04 and newer.

EDIT: Added PIDFile since it doesn't create any problems on Ubuntu.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment