This file is indexed.

/etc/init.d/globus-gridftp-server is in globus-gridftp-server-progs 9.4-2.

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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
#!/bin/bash
#
# globus-gridftp-server - Globus GridFTP Server
# chkconfig: 2345 20 80
# description: The Globus GridFTP server is a process which implements the \
#              GridFTP protocol for secure, high-performance file transfer.
#
### BEGIN INIT INFO
# Provides:          globus-gridftp-server
# Required-Start:    $remote_fs $syslog $network
# Required-Stop:     $remote_fs $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Globus GridFTP Server
# Description:       The Globus GridFTP server is a process which implements
#                    the GridFTP protocol for secure, high-performance file
#                    transfer.
### END INIT INFO

# source function library
. /lib/lsb/init-functions

sbindir=/usr/sbin
sysconfdir=/etc

rc=0
conf=${sysconfdir}/gridftp.conf
confdir=${sysconfdir}/gridftp.d
pidfile=/var/run/globus-gridftp-server.pid
lockfile=/var/lock/globus-gridftp-server
gridftpd=${sbindir}/globus-gridftp-server

# Include defaults if available
if [ -r /etc/default/globus-gridftp-server ] ; then
	. /etc/default/globus-gridftp-server
fi

start() {
	echo -n "Starting globus-gridftp-server"
	rc=0
	if [ ! -f $conf ]; then
		touch $conf
	fi

	if [ -f "$pidfile" ]; then
		read pid < "$pidfile"

		if ! kill -0 $pid; then
			rm "$pidfile"
		fi
	fi

	if [ ! -d $confdir ]; then
		mkdir $confdir;
	fi

	if [ ! -f "$pidfile" ]; then
		$gridftpd -S -c $conf -C $confdir -pidfile "${pidfile}"
		rc=$?
	fi

	[ $rc -eq 0 ] && log_success_msg || log_failure_msg
	[ $rc -eq 0 ] && touch ${lockfile}

	echo
	return $rc
}

stop() {
	echo -n "Stopping globus-gridftp-server"
	if [ -f "$pidfile" ]; then
		read pid < "$pidfile" 2> /dev/null

		if [ "$pid" != "" -a "$pid" -gt 0 ]; then
			if kill -0 "$pid" 2> /dev/null; then
				kill -INT "$pid" 2>/dev/null
				rc=$?
				sleep 2
				kill -0 "$pid" 2> /dev/null && kill -KILL "$pid"
			fi
		fi

		rm -f "$pidfile"
	fi

	[ $rc -eq 0 ] && log_success_msg || log_failure_msg
	[ $rc -eq 0 ] && rm ${lockfile}

	echo
	return $rc
}

restart() {
	stop
	start
}

reload() {
	echo -n "Reloading GridFTP configuration"
	read pid < "$pidfile" 2> /dev/null

	if [ "$pid" != "" -a "$pid" -gt 0 ]; then
		kill -HUP "$pid" 2>/dev/null
		rc=$?
	fi

	[ $rc -eq 0 ] && log_success_msg || log_failure_msg

	return $rc
}

status() {
	if [ -f $pidfile ]; then
		read pid < "$pidfile" 2> /dev/null

		if [ "$pid" != "" -a "$pid" -gt 0 ]; then
			if kill -0 "$pid" 2> /dev/null; then
				echo "GridFTP server is running (pid=$pid)"
				return 0
			else
				echo "Stale PID file $pidfile"
				return 1
			fi
		else
			echo "Invalid PID file $pidfile"
			return 4
		fi
	else
		echo "GridFTP server is not running"
		return 3
	fi
}

case "$1" in
    start)
	start
	;;
    stop)
	stop
	;;
    status)
	status
	;;
    restart | force-reload)
	restart
	;;
    condrestart | try-restart)
	[ -e ${lockfile} ] && restart
	;;
    reload)
	reload
	;;
    *)
	echo "Usage: $0 {start|stop|status|restart|force-reload|condrestart|try-restart|reload}"
	exit 1
	;;
esac
exit $rc