Jump to content

fedora init script


kden

Recommended Posts

I spent a fair bit of time finding an init script that would work on fedora 17, so thought I would share what I finally found to work.

URL found: http://wiki.amahi.org/index.php/Init_scripts

You should just need to create this in /etc/init.d (i used /etc/init.d/utorrent), then change the two variables for utorrent_home & utorrent_user

#!/bin/bash

#

# init script for Utorrent

#

# chkconfig: 345 96 02

# description: Daemon for utorrent

# processname: utorrent

#

UTORRENT_HOME=/opt/utorrent-server-v3_0/

UTORRENT_USER=utorrent

utorrent_start() {

echo Starting uTorrent

mkdir -p /var/run/utorrent

(cd $UTORRENT_HOME; ./utserver -daemon -logfile /var/log/utorrent.log -pidfile /var/run/utorrent.pid)

}

utorrent_stop() {

echo Stopping uTorrent

kill `cat /var/run/utorrent.pid`

}

case "$1" in

start)

utorrent_start

;;

stop)

utorrent_stop

;;

restart)

utorrent_stop;

utorrent_start

;;

*)

echo "Usage: $0 {start|stop|restart}"

exit1

esac

exit 0

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...