mcbot needs a proper system account
mcbot used the nobody system account and changed some properties.
This collides with the default selinux policiy and the new account mcbot solves
this issue.
committer: Markus Bröker <mbroeker@largo.homelinux.org>
#!/bin/sh### BEGIN INIT INFO# Provides: mcbot# Required-Start: $remote_fs $syslog# Required-Stop: $remote_fs $syslog# Default-Start: 2 3 4 5# Default-Stop: 0 1 6# Short-Description: IRC BOT mcbot # Description: IRC BOT mcbot### END INIT INFORUNAS="mcbot"BINARY="mcbot"DIRECTORY="/usr/sbin/"LANGUAGE="de_DE.UTF-8"PARAMETER=""LOGFILE="/var/lib/mcbot/mcbot-`date \"+%d-%m-%y\"`.log"[[ ! -x "${DIRECTORY}/${BINARY}" ]] && exit 0start() { echo -n " * Starting ${BINARY}" su - ${RUNAS} -c "LANG=$LANGUAGE ${DIRECTORY}/${BINARY} ${PARAMETER} &> ${LOGFILE} &" if [ "$?" == 0 ]; then echo " [started]" fi}stop() { echo -n " * Stopping ${BINARY}" pid=`pidof ${BINARY}` if [ "$pid" != "" ]; then kill -TERM `pidof ${BINARY}` sleep 5 fi echo " [stopped]"}status() { pid="`pidof ${BINARY}`" if [ "$pid" != "" ]; then echo "${BINARY} is started as ${pid}" else echo "${BINARY} is not running" fi}case "$1" in start) start ;; stop) stop ;; status) status ;; restart) echo "Restarting ${BINARY}" stop start ;; force-reload) echo "Force reload stub" stop start ;; *) echo "Usage: start|stop|restart|status|force-reload" ;;esacexit 0