Teleport startup service

Hello everyone, I was wondering why downloading the source files from the website, decompressing it, and installing it, doesn’t add an init.d file that allows controlling the service by default.

I added the following file to /etc/init.d/teleport, to allow the service control, it works good.

#!/bin/bash
#
# chkconfig: - 57 75
# description: set the date and time via NTP

### BEGIN INIT INFO
# Provides: Teleport
# Should-Start: $syslog $named
# Short-Description: Teleport Server
# Description: Teleport Auth Server Initiation
### END INIT INFO



# See how we were called.
case "$1" in
  start)
        /usr/local/bin/teleport start
        ;;
  stop)
        ps -ef | grep teleport | grep -v "grep" |  awk ' { print $2}' | xargs kill -15
        ;;
  status)
		if [[ $(ps -ef | grep teleport | grep -v "grep" |  awk '{print $2}') ]]; then
                echo "Teleport Server is Running"
        else
                echo "Teleport Server is not Running"
        fi
        ;;
  restart|force-reload)
        ps -ef | grep teleport | grep -v "grep" |  awk ' { print $2}' | xargs kill -15
        /usr/local/bin/teleport start
        ;;
  *)
        echo $"Usage: $0 {start|stop|status|restart|force-reload}"
        exit 2
esac

any advice if it exists by default. and if not, would it be added?:thinking::thinking:

After moving around the config files, I found systemd and upstart directories in the examples directory, and they have units to enable teleport.service, but again they are not copied by default, I think they should be automated in the install script.

@gus any help you could provide here please.

Thanks in advance. :slightly_smiling_face::slightly_smiling_face:

As of Teleport 4.1 we’re planning to release Teleport in RPM and DEB format to make installation/upgrades easier. The RPM and DEB files will contain the systemd unit and install it by default.

There are no plans to change the current way that Teleport is packaged in tarballs - many users rely on the package format to be consistent for the automation that they’ve already built.

1 Like