This file is indexed.

/etc/init.d/tids is in moonshot-trust-router 1.4.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
#!/bin/bash
### BEGIN INIT INFO
# Provides: tids
# Default-Start: 2 3 4 5
# Default-Stop: 0 1  6
# Required-Start: $local_fs $remote_fs $network
# Required-Stop:local_fs $remote_fs $network
# Should-Start: freeradius
# Short-Description: Starts Moonshot TIDS
# Description: Starts the Moonshot Temporary ID Service
### END INIT INFO

PATH=/sbin:/bin:/usr/sbin:/usr/bin

. /lib/lsb/init-functions

[ -z "$HOME" ] && export HOME=/

usage() {
    echo "Usage: $0 {start|stop|status}"
}

# Load the configuration
[ -f /etc/default/trust_router ] || exit 0
. /etc/default/trust_router
TIDS_PIDDIR=/var/run/trust_router
TIDS_LOGDIR=/var/log/trust_router

# Create the PID and LOG directories
[ -d "$TIDS_PIDDIR" ] || mkdir -p $TIDS_PIDDIR && chown $TIDS_USER:$TIDS_GROUP $TIDS_PIDDIR
[ -d "$TIDS_LOGDIR" ] || mkdir -p $TIDS_LOGDIR && chown $TIDS_USER:$TIDS_GROUP $TIDS_LOGDIR

# Some variables
prog=/usr/lib/trust_router/tids-wrapper
PIDFILE="$TIDS_PIDDIR/tids.pid"
LOGFILE="$TIDS_LOGDIR/tids.log"

# Does the trust router and wrapper exist
[ -x /usr/bin/tids ] || exit 5
[ -x $prog ] || exit 5

[ -f "$LOGFILE" ] || touch $LOGFILE && chown $TIDS_USER:$TIDS_GROUP $LOGFILE

OPTIONS="$PIDFILE $LOGFILE $ipaddr $gssname $hostname /var/lib/trust_router/keys"

case $1 in
    start)
        if [ -f ${PIDFILE} ] ;
        then
                OLD_PID=$(cat "$PIDFILE")

                if [ -d "/proc/$OLD_PID" ] ;
                then
                        echo "Error: TIDS already running" ; exit 1
                else
                        rm $PIDFILE
                fi
        fi

        timestamp=$(date)
        echo "$timestamp Starting TIDS..." >> $LOGFILE
        log_daemon_msg "Starting TIDS" "tids"
        start-stop-daemon --start --chuid $TIDS_USER --pidfile $PIDFILE --oknodo --startas $prog $OPTIONS
        status=$?
        log_end_msg $status
        ;;
    stop)
        timestamp=$(date)
        echo "$timestamp Stopping TIDS..." >> $LOGFILE
        log_daemon_msg "Stopping TIDS" "tids"
        start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE
        status=$?
        log_end_msg $status
        rm -f $PIDFILE
        ;;
    status)
        if [ -f $PIDFILE ] ;
        then
                PID=$(cat "$PIDFILE")

                if [ -d "/proc/$PID" ] ;
                then
                        echo "TIDS is running (pid $PID)"
                else
                        if [ -e $PIDFILE ] ; then
                                echo "TIDS appears to be dead but its PID file exists"
                        else
                                echo "TIDS appears to be stopped"
                        fi
                fi
        else
                echo "TIDS appears to be stopped"
        fi
        exit 0
        ;;
    reload | force-reload | condrestart | try-restart)
        usage
        exit 3
        ;;
    *)
        usage
        exit 2
        ;;
esac