Indice del forum Olimpo Informatico
I Forum di Zeus News
Leggi la newsletter gratuita - Attiva il Menu compatto
 
 FAQFAQ   CercaCerca   Lista utentiLista utenti   GruppiGruppi   RegistratiRegistrati 
 ProfiloProfilo   Messaggi privatiMessaggi privati   Log inLog in 

    Newsletter RSS Facebook Twitter Contatti Ricerca
[Lubuntu 13.10] Script di x11vnc all'avvio
Nuovo argomento   Rispondi    Indice del forum -> *Ubuntu
Precedente :: Successivo  
Autore Messaggio
balubeto
Dio minore
Dio minore


Registrato: 19/05/06 08:22
Messaggi: 757

MessaggioInviato: 06 Apr 2014 08:52    Oggetto: [Lubuntu 13.10] Script di x11vnc all'avvio Rispondi citando

Ciao

Ho trovato questo link link che contiene uno script di x11vnc da inserire nella directory /etc/init.d . Essendo un vecchio script, ho trasformato in :

Codice:

#!/bin/sh

case "$1" in
        start)
                start-stop-daemon --start --oknodo \
                        --pidfile /var/run/x11vnc.pid --background \
                        --nicelevel 15 --make-pidfile --exec \
                        /usr/bin/x11vnc -rfbport 5900 -auth /var/run/lightdm/root/:0 -rfbauth /etc/x11vnc.pass -nomodtweak -noxrecord -shared -forever -loop -o /var/log/x11vnc.log
        ;;
        stop)
                start-stop-daemon --stop --oknodo --pidfile /var/run/x11vnc.pid
        ;;
        restart)
                $0 stop
                $0 start
        ;;
        *)
                echo "Usage: $0 start|stop|restart"
        ;;
esac

exit 0




Quindi ho scritto i comandi sudo chmod 755 /etc/init.d/x11vnc e sudo ln -s /etc/init.d/x11vnc /etc/rc2.d/S99x11vnc . Infatti:

Codice:

lrwxrwxrwx 1 root root 18 apr  4 19:21 /etc/rc2.d/S99x11vnc -> /etc/init.d/x11vnc


I comandi per creare la password non li ho fatti in quanto li avevo gia fatti. Dunque, ho riavviato la macchina, ma il server x11vnc non e` partito ed in piu` non mi ha creato nessun file log.

Quindi, ho provato ad eseguire il comando sudo /etc/init.d/x11vnc start e come l'ouput esce:

Codice:

start-stop-daemon: invalid option -- 'f'


Come mai?

Grazie

Ciao
Top
Profilo Invia messaggio privato
balubeto
Dio minore
Dio minore


Registrato: 19/05/06 08:22
Messaggi: 757

MessaggioInviato: 07 Apr 2014 12:02    Oggetto: Rispondi

Ho creato questo script:

Codice:

#! /bin/sh
#
### BEGIN INIT INFO
# Provides: x11vnc
# Required-Start: $syslog $local_fs
# Required-Stop: $syslog $local_fs
# Should-Start: LightDM
# Default-Start: 2
# Default-Stop: 1
# Short-Description: x11 vnc
# Description: x11vnc
### END INIT INFO

DAEMON=/usr/bin/x11vnc
NAME=x11vnc
DESC="X11 vnc"

test -x $DAEMON || exit 0

DAEMON_OPTS="-auth /var/run/lightdm/root/:0 -rfbauth /etc/x11vnc.pass -nomodtweak -shared -forever -o /var/log/x11vnc.log -bg"

set -e

 case "$1" in
           start)
                   echo -n "Starting $DESC: "
                   start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \
                                                     --exec $DAEMON -- $DAEMON_OPTS &
                   echo "$NAME."
           ;;
           stop)
                   echo -n "Stopping $DESC: "
                   start-stop-daemon --stop --oknodo --quiet --pidfile /var/run/$NAME.pid \
                                                    --exec $DAEMON
                   echo "$NAME."
           ;;
           restart)
                      echo -n "Restarting $DESC: "
                      start-stop-daemon --stop --quiet --pidfile \
                      /var/run/$NAME.pid --exec $DAEMON
                      sleep 1
                      start-stop-daemon --start --quiet --pidfile \
                      /var/run/$NAME.pid --exec $DAEMON -- $DAEMON_OPTS
                      echo "$NAME."
          ;;
          status)
                     if [ -s /var/run/$NAME.pid ]; then
                        RUNNING=$(cat /var/run/$NAME.pid)
                        if [ -d /proc/$RUNNING ]; then
                            if [ $(readlink /proc/$RUNNING/exe) = $DAEMON ]; then
                                echo "$NAME is running."
                                exit 0
                            fi
                        fi
                        # No such PID, or executables don't match
                        echo "$NAME is not running, but pidfile existed."
                        rm /var/run/$NAME.pid
                        exit 1
                     else
                           rm -f /var/run/$NAME.pid
                           echo "$NAME not running."
                           exit 1
                     fi
          ;;
          *)
            N=/etc/init.d/$NAME
            echo "Usage: $N {start|stop|restart|force-reload}" >&2
            exit 1
           ;;
 esac

exit 0


ed ho salvato in /etc/init.d/x11vnc e, a quanto pare, funziona e riesco a controllare anche il LightDM.

Ora, proseguo nel mio thread principale http://forum.zeusnews.com/viewtopic.php?t=65311 .

Grazie

Ciao
Top
Profilo Invia messaggio privato
Mostra prima i messaggi di:   
Nuovo argomento   Rispondi    Indice del forum -> *Ubuntu Tutti i fusi orari sono GMT + 1 ora
Pagina 1 di 1

 
Vai a:  
Non puoi inserire nuovi argomenti
Non puoi rispondere a nessun argomento
Non puoi modificare i tuoi messaggi
Non puoi cancellare i tuoi messaggi
Non puoi votare nei sondaggi