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
|
||||
|
||||
PATH=$PATH:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin
|
||||
DAEMON="snail-watcher.sh"
|
||||
DAEMON_ARGS=""
|
||||
PIDFILE=/var/run/snail.pid
|
||||
PATH=$PATH:/usr/local/bin
|
||||
PIDFILE=/var/run/snail-watcher.pid
|
||||
|
||||
depend() {
|
||||
need localmount
|
||||
|
@ -14,8 +14,8 @@ start() {
|
|||
start-stop-daemon --make-pidfile \
|
||||
--background \
|
||||
--start \
|
||||
--exec $DAEMON \
|
||||
--pidfile $PIDFILE \
|
||||
--exec $DAEMON \
|
||||
-- $DAEMON_ARGS
|
||||
eend $?
|
||||
}
|
||||
|
@ -23,7 +23,6 @@ start() {
|
|||
stop() {
|
||||
ebegin "Stopping ${SVCNAME}"
|
||||
start-stop-daemon --stop \
|
||||
--exec $DAEMON \
|
||||
--pidfile $PIDFILE
|
||||
eend $?
|
||||
}
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
#!/sbin/runscript
|
||||
|
||||
PATH=$PATH:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin
|
||||
DAEMON=/usr/bin/X
|
||||
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() {
|
||||
need xdm
|
||||
|
@ -11,23 +12,28 @@ depend() {
|
|||
start() {
|
||||
ebegin "Starting Snail nVidia Optimus"
|
||||
snail.nv_pwr_on || eend -1
|
||||
! ps -p `cat $PIDFILE 2>&1` > /dev/null 2>&1 || eend -1
|
||||
export LD_LIBRARY_PATH=/usr/lib/opengl/nvidia/lib:/usr/lib/opengl/nvidia/lib
|
||||
start-stop-daemon --start --quiet --background --pidfile $PIDFILE --exec $DAEMON -- $DAEMON_ARGS
|
||||
export LD_LIBRARY_PATH=/usr/lib/snail
|
||||
export LD_PRELOAD=/usr/lib/snail/libGL.so
|
||||
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=$?
|
||||
# FIXME: remove --background flag and next cycle
|
||||
let i=300
|
||||
while [ 0 -lt $i ]; do
|
||||
[ -f $PIDFILE ] && pgrep -s `cat $PIDFILE` &>/dev/null && break
|
||||
sleep 0.01
|
||||
let i--
|
||||
done
|
||||
[ ! -z $pid ] && pgrep -s $pid X &>/dev/null && echo "Already running..."
|
||||
eend $status
|
||||
}
|
||||
|
||||
stop() {
|
||||
ebegin "Stopping Snail nVidia Optimus"
|
||||
kill `cat $PIDFILE 2>&1` > /dev/null 2>&1
|
||||
snail.nv_pwr_off || eend -1
|
||||
eend $result
|
||||
start-stop-daemon --stop --pidfile $PIDFILE
|
||||
snail.nv_pwr_off
|
||||
eend $?
|
||||
}
|
||||
|
|
|
@ -86,7 +86,7 @@ while [ 0 -lt $retry ]; do
|
|||
;;
|
||||
esac
|
||||
|
||||
sleep 0.01
|
||||
sleep 0.2
|
||||
let retry--
|
||||
echo "retry countdown: $retry"
|
||||
done
|
||||
|
|
Loading…
Reference in New Issue