aboutsummaryrefslogtreecommitdiffstats
path: root/extra/oidentd/oidentd.initd
blob: c40b058dac8191490467ae905785125e40067063 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/sbin/runscript
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/www/viewcvs.gentoo.org/raw_cvs/gentoo-x86/net-misc/oidentd/files/oidentd-2.0.7-init,v 1.4 2007/10/24 11:38:14 uberlord Exp $

depend() {
    need net
}

check_config() {
	if [ -z "${USER}" ]
	then
		eerror "Please set \$USER in /etc/conf.d/oidentd!"
		return 1
	fi
	if [ -z "${GROUP}" ]
	then
		eerror "Please set \$GROUP in /etc/conf.d/oidentd!"
		return 1
	fi

	if [ "$(sysctl -n security.bsd.see_other_uids 2>/dev/null)" = "0" ]; then
		eerror "${SVCNAME} cannot work if the sysctl security.bsd.see_other_uids is 0"
		return 1
	fi
}


start() {
	check_config || return 1
	ebegin "Starting oidentd"
	OPTIONS="${OPTIONS} -u ${USER} -g ${GROUP}"
	start-stop-daemon --start --quiet --exec /usr/sbin/oidentd -- $OPTIONS
	eend $?
}

stop() {
	ebegin "Stopping oidentd"
	start-stop-daemon --stop --quiet --exec /usr/sbin/oidentd
	eend $?
}