This file is indexed.

/etc/init.d/iwpmd is in rdma-core 17.1-1.

This file is owned by root:root, with mode 0o755.

The actual contents of the file can be viewed below.

  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
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
#!/bin/bash
# Start the IWPMD daemon
#
# chkconfig: 1235 90 15
# description: iWarp Port Mapper Daemon for opening sockets to reserve ports from userspace
# processname: iwpmd
# pidfile: /var/run/iwpmd.pid
#
### BEGIN INIT INFO
# Provides: iwpmd
# Required-Start: $network $syslog $remote_fs
# Required-Stop: $remote_fs
# Default-Stop: 0 1 6
# Default-Start: 2 3 4 5
# Short-Description: iWarp Port Mapper Daemon
# Description: iWarp Port Mapper Daemon for opening sockets to claim TCP ports from userspace
### END INIT INFO

IWPMD_BIN="/usr/sbin/iwpmd"
LOCK="/var/lock/subsys/iwpmd"
IWPMD_PID=0
RETVAL=0

# Source function library.
if [ -f "/etc/redhat-release" ]; then
	. /etc/rc.d/init.d/functions
	STARTD=daemon
	STOPD=killproc
	STATUSD=status
	GETPID=/sbin/pidof

else
	# Debian / openSUSE / Ubuntu
	. /lib/lsb/init-functions
	STARTD=start_daemon
	STOPD=killproc
	STATUSD=/sbin/checkproc
	GETPID=pidofproc
fi

check() {
	# Check if iwpm is executable
	test -x $IWPMD_BIN || ( echo "Couldn't find $IWPMD_BIN"; exit 5 )
}

start() {
	check
	RETVAL=$?
	[ $RETVAL -gt 0 ] && exit $RETVAL

	echo -n $"Starting iwpm daemon: "
	if [ ! -f "$LOCK" ]; then
		ulimit -n 102400
		$STARTD $IWPMD_BIN &> /dev/null
		RETVAL=$?
		[ $RETVAL -eq 0 ] && ( touch $LOCK; echo "OK" ) || echo "NO"
	else
		echo "NO (iwpm is already running)"
	fi
	return $RETVAL
}

stop() {
	check
	RETVAL=$?
	[ $RETVAL -gt 0 ] && exit $RETVAL

	echo -n $"Stopping iwpm daemon: "
	if [ -f "$LOCK" ]; then
		$STOPD $IWPMD_BIN &> /dev/null
		RETVAL=$?
		[ $RETVAL -eq 0 ] && ( rm -f $LOCK; echo "OK" ) || echo "NO"
	else
		echo "NO (iwpm is already stopped)"
	fi
	return $RETVAL
}

restart() {
	stop
	start
}

show_status() {
	check
	RETVAL=$?
	[ $RETVAL -gt 0 ] && exit $RETVAL

	IWPMD_PID="$($GETPID $IWPMD_BIN)"
	$STATUSD $IWPMD_BIN &> /dev/null
	RETVAL=$?
	[ $RETVAL -eq 0 ] && echo "iwpm daemon (pid $IWPMD_PID) is running" || echo "iwpm daemon isn't available"

	return $RETVAL
}

case "$1" in
start)
	start
	;;
stop)
	stop
	;;
restart)
	restart
	;;
force-reload)
	restart
	;;
status)
	show_status
	;;
*)
	echo $"Usage: $0 {start|stop|restart|force-reload|status}"
	RETVAL=2
esac

exit $RETVAL