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?