Changeset 1296 for epoptes


Ignore:
Timestamp:
Apr 28, 2016, 9:15:46 AM (3 years ago)
Author:
mabarracus
Message:

Fix Epoptes client gracefully exitting

Location:
epoptes/trunk/fuentes
Files:
1 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • epoptes/trunk/fuentes/debian/changelog

    r1263 r1296  
     1epoptes (0.5.9-lliurex4) xenial; urgency=medium
     2
     3  * Fix Epoptes client gracefully exitting
     4
     5 -- M.Angel Juan <m.angel.juan@gmail.com>  Thu, 28 Apr 2016 09:14:27 +0200
     6
    17epoptes (0.5.9-lliurex3) xenial; urgency=high
    28
  • epoptes/trunk/fuentes/debian/rules

    r1252 r1296  
    1212endif
    1313
    14 override_dh_install:
    15         dh_install
    16         mkdir -p debian/epoptes-client/etc/lightdm/ExitSession.d
    17         cp debian/killer-epoptes debian/epoptes-client/etc/lightdm/ExitSession.d/
    18 
    1914%:
    2015        dh $@ --with $(PYTHON_VARIANT)
  • epoptes/trunk/fuentes/epoptes-client/epoptes-client

    r1252 r1296  
    229229# (for standalone workstations booted before the server).
    230230RUN=1
    231 salida(){
    232                 RUN=0
    233         }
    234 trap salida KILL
    235 trap salida TERM
    236 trap salida QUIT
    237 trap salida INT
    238 trap salida STOP
     231salida(){
     232        RUN=0
     233        kill -9 $BASHPID
     234}
     235
     236trap salida KILL TERM QUIT INT STOP
     237
    239238if [ -s /etc/epoptes/server.crt ] || [ "$cert_param" = "verify=0" ]; then
    240     while [ ${RUN} -eq 1 ]; do
    241         socat openssl-connect:$SERVER:$PORT,$cert_param,interval=60,forever EXEC:"$cmdline"
    242         sleep 1
     239    while [ ${RUN} -eq 1 ] && sleep 1; do
     240        ALIVE=$(ps ax|grep $PPID|grep -v grep|wc -l)
     241        socat openssl-connect:$SERVER:$PORT,$cert_param,interval=60,forever EXEC:"$cmdline",sigint,sigquit
     242        if [ "x${ALIVE}" != "x1" ]; then
     243            exit 1
     244        fi
    243245    done;
    244246elif [ -f /etc/epoptes/server.crt ]; then
    245     while [ ${RUN} -eq 1 ]; do
     247    while [ ${RUN} -eq 1 ] && sleep 1; do
     248        ALIVE=$(ps ax|grep $PPID|grep -v grep|wc -l)
    246249        socat tcp:$SERVER:$PORT,interval=60,forever EXEC:"$cmdline",nofork
    247         sleep 1
     250        if [ "x${ALIVE}" != "x1" ]; then
     251            exit 1
     252        fi
    248253    done;
    249254else
    250     die "
    251 The epoptes certificate file, /etc/epoptes/server.crt, doesn't exist.
    252 You can fetch the server certificate by running:
    253 $0 -c"
    254 fi
     255    $0 -c
     256    exec $0
     257fi
Note: See TracChangeset for help on using the changeset viewer.