Nowe posty

xx Problem ze sterownikami. (5)
2024-04-13, 21:25:16
xx Instalacja xfce4 (2)
2024-04-13, 16:20:17
xx Serie kompilacji bez instalacji dla “emerge” w Gentoo (2)
2024-04-08, 18:40:04
xx Plasma 6 w Neonie ssie trochę mniej ... (17)
2024-04-05, 10:03:46
xx Problem z Linux Lite po instalacji (3)
2024-04-03, 14:23:40
xx Jak właczyć num locka przy starcie systemu debian 12? (12)
2024-04-02, 17:43:54
xx Brak dźwieku w systemie. (5)
2024-04-02, 16:13:41
xx Dystrybucja pod HP Omen (7)
2024-03-29, 11:33:05
xx [Poradnik] Wyszukiwanie Sterowników (2)
2024-03-27, 21:08:23
xx Ile pingwinów? (1)
2024-03-27, 08:59:24

Autor Wątek: event.php zależy mi  (Przeczytany 2202 razy)

koza1212

  • Gość
event.php zależy mi
« dnia: 2012-12-19, 18:55:56 »
Witam serdecznie, niestety nie umiem sobie poradzic z tym, czy mógłby mi to ktoś zrobic?

Pozdrawiam i dziękuję serdecznie.

http://www.nopaste.pl/1hqy


    Skrypt ma uruchamiać event.php dostepny /opt/twlan/htdocs/welt2/daemons 
    To skrypt z s1:
     
     
     
     
    #!/bin/sh
    # Copyright 2010 Lekensteyn
    # This script is public domain and comes with NO WARRANTY of any kind
    #
    # Events handler (handles build queue, attacks, etc)
    if test `id -u` -eq 0;then
       sudo -u nobody -- "$0"
       exit
    fi
    running=true
    trap 'running=false' 1 2 3 15
    cd "$(dirname "$0")/.."
    BASEDIR="`pwd`"
    PIDFILE="$BASEDIR/tmp/event.pid"
    killed=
    # if a pidfile still exist (unclean shutdown), kill that pid and wait
    # 2 seconds for it to catch our signal
    test -f "$PIDFILE" && kill -15 "`cat "$PIDFILE"`" >/dev/null && killed=1
    printf $$ > "$PIDFILE"
    test -n "$killed" && sleep 2
    cd htdocs/daemons
    run(){
       test -f "$PIDFILE" || exit 2
       sleep 1
       if test ! -S "$BASEDIR/tmp/mysql.sock";then
          echo 'MySQL is not running.'
          return
       fi
       # start PHP, run build queues, attacks, etc
       env -i LD_LIBRARY_PATH="$BASEDIR/lib" "$BASEDIR/php/php" event.php &
       pid=$!
       # check if we still should run (if we have not been killed)
       while $running;do
          # is PHP not running anymore? Restart it
          if ! kill -0 $pid 2>/dev/null >/dev/null;then
             run
             return
          fi
          # and wait a second as we do not have to check realtime
          sleep 1
       done
       # kill PHP
       kill -15 $pid 2>/dev/null >/dev/null
    }
    run
    detect_pid=`cat "$PIDFILE"`
    test "$detect_pid" = $$ && rm -f "$PIDFILE"