init.d services fixed, need to fix snail.configure (symlinks creation).
This commit is contained in:
parent
8784295d71
commit
b3da7ee246
|
@ -1,9 +1,9 @@
|
||||||
#!/sbin/runscript
|
#!/sbin/runscript
|
||||||
|
|
||||||
|
PATH=$PATH:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin
|
||||||
DAEMON="snail-watcher.sh"
|
DAEMON="snail-watcher.sh"
|
||||||
DAEMON_ARGS=""
|
DAEMON_ARGS=""
|
||||||
PIDFILE=/var/run/snail.pid
|
PIDFILE=/var/run/snail-watcher.pid
|
||||||
PATH=$PATH:/usr/local/bin
|
|
||||||
|
|
||||||
depend() {
|
depend() {
|
||||||
need localmount
|
need localmount
|
||||||
|
@ -14,8 +14,8 @@ start() {
|
||||||
start-stop-daemon --make-pidfile \
|
start-stop-daemon --make-pidfile \
|
||||||
--background \
|
--background \
|
||||||
--start \
|
--start \
|
||||||
--exec $DAEMON \
|
|
||||||
--pidfile $PIDFILE \
|
--pidfile $PIDFILE \
|
||||||
|
--exec $DAEMON \
|
||||||
-- $DAEMON_ARGS
|
-- $DAEMON_ARGS
|
||||||
eend $?
|
eend $?
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,6 @@ start() {
|
||||||
stop() {
|
stop() {
|
||||||
ebegin "Stopping ${SVCNAME}"
|
ebegin "Stopping ${SVCNAME}"
|
||||||
start-stop-daemon --stop \
|
start-stop-daemon --stop \
|
||||||
--exec $DAEMON \
|
|
||||||
--pidfile $PIDFILE
|
--pidfile $PIDFILE
|
||||||
eend $?
|
eend $?
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
#!/sbin/runscript
|
#!/sbin/runscript
|
||||||
|
|
||||||
|
PATH=$PATH:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin
|
||||||
DAEMON=/usr/bin/X
|
DAEMON=/usr/bin/X
|
||||||
DAEMON_ARGS="-ac -config /etc/X11/xorg.conf.nvidia -sharevts -modulepath /usr/lib/snail -nolisten tcp -noreset :1 vt9"
|
DAEMON_ARGS="-ac -config /etc/X11/xorg.conf.nvidia -sharevts -modulepath /usr/lib/snail -nolisten tcp -noreset :1 vt9"
|
||||||
PIDFILE=/tmp/.X1-lock
|
PIDFILE=/var/run/snail-xserver.pid
|
||||||
|
|
||||||
depend() {
|
depend() {
|
||||||
need xdm
|
need xdm
|
||||||
|
@ -11,23 +12,28 @@ depend() {
|
||||||
start() {
|
start() {
|
||||||
ebegin "Starting Snail nVidia Optimus"
|
ebegin "Starting Snail nVidia Optimus"
|
||||||
snail.nv_pwr_on || eend -1
|
snail.nv_pwr_on || eend -1
|
||||||
! ps -p `cat $PIDFILE 2>&1` > /dev/null 2>&1 || eend -1
|
export LD_LIBRARY_PATH=/usr/lib/snail
|
||||||
export LD_LIBRARY_PATH=/usr/lib/opengl/nvidia/lib:/usr/lib/opengl/nvidia/lib
|
export LD_PRELOAD=/usr/lib/snail/libGL.so
|
||||||
start-stop-daemon --start --quiet --background --pidfile $PIDFILE --exec $DAEMON -- $DAEMON_ARGS
|
pid=`cat $PIDFILE 2>/dev/null`
|
||||||
|
rm -f $PIDFILE
|
||||||
|
[ -z $pid ] || ! pgrep -s $pid X &>/dev/null && \
|
||||||
|
echo "No Snail found running. Starting it..." && \
|
||||||
|
start-stop-daemon \
|
||||||
|
--start \
|
||||||
|
--quiet \
|
||||||
|
--background \
|
||||||
|
--make-pidfile \
|
||||||
|
--pidfile $PIDFILE \
|
||||||
|
--exec $DAEMON \
|
||||||
|
-- $DAEMON_ARGS
|
||||||
status=$?
|
status=$?
|
||||||
# FIXME: remove --background flag and next cycle
|
[ ! -z $pid ] && pgrep -s $pid X &>/dev/null && echo "Already running..."
|
||||||
let i=300
|
|
||||||
while [ 0 -lt $i ]; do
|
|
||||||
[ -f $PIDFILE ] && pgrep -s `cat $PIDFILE` &>/dev/null && break
|
|
||||||
sleep 0.01
|
|
||||||
let i--
|
|
||||||
done
|
|
||||||
eend $status
|
eend $status
|
||||||
}
|
}
|
||||||
|
|
||||||
stop() {
|
stop() {
|
||||||
ebegin "Stopping Snail nVidia Optimus"
|
ebegin "Stopping Snail nVidia Optimus"
|
||||||
kill `cat $PIDFILE 2>&1` > /dev/null 2>&1
|
start-stop-daemon --stop --pidfile $PIDFILE
|
||||||
snail.nv_pwr_off || eend -1
|
snail.nv_pwr_off
|
||||||
eend $result
|
eend $?
|
||||||
}
|
}
|
||||||
|
|
|
@ -86,7 +86,7 @@ while [ 0 -lt $retry ]; do
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
sleep 0.01
|
sleep 0.2
|
||||||
let retry--
|
let retry--
|
||||||
echo "retry countdown: $retry"
|
echo "retry countdown: $retry"
|
||||||
done
|
done
|
||||||
|
|
Loading…
Reference in New Issue