logo

overlay

My own overlay for experimentations, use with caution, no support is provided git clone https://hacktivis.me/git/overlay.git

unrealircd.initd-r2 (1162B)


  1. #!/sbin/openrc-run
  2. # Copyright 1999-2018 Gentoo Authors
  3. # Distributed under the terms of the GNU General Public License v2
  4. # Defaults
  5. : ${UNREALIRCD_CONF:=/etc/unrealircd/${SVCNAME}.conf}
  6. : ${UNREALIRCD_PIDFILE:=/run/unrealircd/${SVCNAME#unreal}.pid}
  7. command="/usr/bin/unrealircd"
  8. # Run the daemon in the foreground and let OpenRC background it.
  9. # This way the PID file is created securely, as root.
  10. command_args="-F -f ${UNREALIRCD_CONF} ${UNREALIRCD_OPTS}"
  11. command_user=unrealircd
  12. command_background=true
  13. pidfile="${UNREALIRCD_PIDFILE}"
  14. start_stop_daemon_args="${UNREALIRCD_SSD_OPTS}"
  15. extra_started_commands="reload"
  16. depend() {
  17. use dns net
  18. provide ircd
  19. }
  20. # It is unsafe for the unrealircd user to be able to write to its own
  21. # PID file, since root will be sending e.g. kill signals to the PID
  22. # listed in that file. Ensure that we overwrite the ownership and
  23. # permissions on /run/unrealircd from previous init scripts.
  24. start_pre() {
  25. checkpath --directory --owner root:root --mode 0700 /run/unrealircd
  26. }
  27. reload() {
  28. ebegin "Reloading ${RC_SVCNAME}"
  29. start-stop-daemon --signal HUP \
  30. --pidfile "${pidfile}" \
  31. ${UNREALIRCD_SSD_OPTS}
  32. eend $?
  33. }