Ushare startup on Boot script

Questions about applications and software
Forum rules
Before you post please read how to get help

Ushare startup on Boot script

Postby wo2caisley on Fri Oct 03, 2008 8:34 am

Hey All,

I have ushare running the way I want it, but cannot get it to start on boot. I have searched and found some info and done the following;

created links as below;

cd /etc/rc2.d
ln -s ../init.d/ushare S99ushare
cd /etc/rc0.d
ln -s ../init.d/ushare K02ushare
cd /etc/rc6.d
ln -s ../init.d/ushare K02ushare

When that was done, I rebooted but noting changed. Still had to start ushare in the terminal prompt.

My ushare script - /etc/init.d/ushare looks like below. Anyone able to help?

#!/bin/sh -e
#
# uShare init script
#
### BEGIN INIT INFO
# Provides: ushare
# Required-Start: $local_fs $syslog $network
# Should-Start:
# Required-Stop:
# Should-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: uShare
# Description: uShare UPnP (TM) A/V & DLNA Media Server
# You should edit configuration in /etc/ushare.conf file
# See http://ushare.geexbox.org for details
### END INIT INFO

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/bin/ushare
NAME=ushare
DESC="uShare UPnP A/V & DLNA Media Server"
PIDFILE=/var/run/ushare.pid
CONFIGFILE=/etc/ushare.conf

# abort if no executable exists
[ -x $DAEMON ] || exit 0

# Get lsb functions
. /lib/lsb/init-functions
. /etc/default/rcS

[ -f /etc/default/ushare ] && . /etc/default/ushare

checkpid() {
[ -e $PIDFILE ] || touch $PIDFILE
}

check_shares() {
if [ -r "$CONFIGFILE" ]; then
. $CONFIGFILE
[ -n "$USHARE_DIR" ] && return 0
fi
return 1
}

case "$1" in
start)
log_daemon_msg "Starting $DESC: $NAME"
if ! $(check_shares); then
log_warning_msg "No shares avalaible ..."
log_end_msg 0
else
checkpid
start-stop-daemon --start --quiet --background --oknodo \
--make-pidfile --pidfile $PIDFILE \
--exec $DAEMON -- $USHARE_OPTIONS
log_end_msg $?
fi
;;
stop)
log_daemon_msg "Stopping $DESC: $NAME"
start-stop-daemon --stop --signal 2 --quiet --oknodo --pidfile $PIDFILE
log_end_msg $?
;;
reload|force-reload)
log_daemon_msg "Reloading $DESC: $NAME"
start-stop-daemon --stop --signal 1 --quiet --oknodo --pidfile $PIDFILE --exec $DAEMON
log_end_msg $?
;;
restart)
$0 stop
$0 start
;;
*)
N=/etc/init.d/$NAME
log_success_msg "Usage: $N {start|stop|restart|reload|force-reload}"
exit 1
;;
esac

exit 0
wo2caisley
Level 1
Level 1
 
Posts: 15
Joined: Wed Jul 23, 2008 5:55 am

Linux Mint is funded by ads and donations.
 

Re: Ushare startup on Boot script

Postby Husse on Fri Oct 03, 2008 3:05 pm

I wonder if a path ../ works try to replace the .. with /etc
Also I don't find my cheat sheet for rc so I don't know for sure if these are right, but I think so
Image
Don't fix it if it ain't broken, don't break it if you can't fix it
Husse
Level 21
Level 21
 
Posts: 19703
Joined: Sun Feb 11, 2007 7:22 am
Location: Near Borås Sweden


Return to Software & Applications

Who is online

Users browsing this forum: Bing [Bot] and 25 guests