inspircd.initd (1189B)
1 #!/sbin/openrc-run
2 # Copyright 1999-2017 Gentoo Foundation
3 # Distributed under the terms of the GNU General Public License v2
4
5 : ${INSPIRCD_USER:="inspircd"}
6 : ${INSPIRCD_GROUP:="inspircd"}
7 : ${INSPIRCD_CONFIGFILE:="/etc/inspircd/inspircd.conf"}
8 : ${INSPIRCD_PIDFILE:="/run/inspircd/inspircd.pid"}
9 : ${INSPIRCD_SSDARGS:="--quiet --wait 1000"}
10 : ${INSPIRCD_TERMTIMEOUT:="TERM/25/KILL/5"}
11 : ${INSPIRCD_OPTS:=""}
12
13 command="/usr/bin/inspircd"
14 command_args="${INSPIRCD_OPTS} --config \"${INSPIRCD_CONFIGFILE}\""
15 command_user="${INSPIRCD_USER}"
16 start_stop_daemon_args="${INSPIRCD_SSDARGS}"
17 pidfile="${INSPIRCD_PIDFILE}"
18 retry="${INSPIRCD_TERMTIMEOUT}"
19
20 required_files="${INSPIRCD_CONFIGFILE}"
21
22 name="InspIRCd"
23
24 description="InspIRCd is a modular Internet Relay Chat (IRC) server."
25
26 extra_commands="version"
27 extra_started_commands="rehash"
28
29 depend() {
30 use dns
31 provide ircd
32 }
33
34 start_pre() {
35 checkpath --directory --mode 0750 --owner ${INSPIRCD_USER}:${INSPIRCD_GROUP} "$(dirname "${INSPIRCD_PIDFILE}")"
36 }
37
38 rehash() {
39 ebegin "Rehashing InspIRCd"
40 start-stop-daemon --signal HUP --pidfile "${pidfile}"
41 eend $?
42 }
43
44 version() {
45 ebegin "Retrieve InspIRCd version"
46 ${command} --version
47 eend $?
48 }