Changeset af50abb


Ignore:
Timestamp:
01/09/14 07:14:44 (7 months ago)
Author:
Ken Moore <ken@…>
Branches:
master, releng/10.0, releng/10.0.1, releng/10.0.2
Children:
5f0dacc
Parents:
2550222
Message:

Add rc.d shutdown detection to PCDM as well as the ability to "stop" the PCDMd script (after the current session finishes).

Location:
src-qt4/PCDM
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src-qt4/PCDM/PCDMd

    r89cdf9c7 raf50abb  
    66PCDMCONF="/usr/local/etc/pcdm.conf" 
    77BASEPCDMAUTHFILE="/tmp/.PCDMAuth" 
     8STOPFILE="/tmp/.PCDMstop" 
     9 
     10#Quick check that this is not the "stop" command 
     11if [ "${1}" = "stop" ]; then 
     12  touch ${STOPFILE} 
     13  exit 
     14fi 
    815 
    916XOPTS="" 
     
    3744touch /tmp/.PCDMAutoLogin 
    3845# Now start the X Server 
    39 while [ ! -e /var/run/nologin ]; do 
     46while [ ! -e /var/run/nologin -a ! -e ${STOPFILE} ]; do 
    4047  /usr/local/bin/pc-checkxdisplay 
    4148  # Randomize the authorization file location 
     
    5663  rm ${PCDMAUTHFILE} 
    5764done 
     65 
     66#Remove the stopfile if it exists 
     67rm ${STOPFILE} 
  • src-qt4/PCDM/rc.d/pcdm

    rc8639a2 raf50abb  
    33# PROVIDE: pcdm 
    44# REQUIRE: LOGIN cleanvar moused syscons dbus 
    5 # 
     5# KEYWORD: shutdown 
    66# Add the following to /etc/rc.conf to start PCDM at boot time: 
    77# 
     
    5353} 
    5454 
     55pcdm_stop() 
     56{ 
     57  #Send the PCDM daemon the signal not to start a new session after this one finishes 
     58  ${command} stop 
     59} 
     60 
    5561run_rc_command "$1" 
  • src-qt4/PCDM/src/main.cpp

    r15cf8b7 raf50abb  
    2727#define TMPAUTOLOGINFILE QString("/tmp/.PCDMAutoLogin") 
    2828#define TMPAUTHFILE QString("/tmp/.PCDMAuth") 
     29#define TMPSTOPFILE QString("/tmp/.PCDMstop") 
    2930//Make sure that prefix is set 
    3031//#ifndef prefix 
     
    155156  } 
    156157  //check for shutdown process 
    157   if( system("pgrep shutdown") == 0 || system("pgrep reboot") == 0 || system("pgrep halt") == 0 || retCode > 0){ 
     158  if( QFile::exists(TMPSTOPFILE) || QFile::exists("/var/run/nologin") || retCode > 0){ 
    158159    splash.showMessage(QObject::tr("System Shutting Down"), Qt::AlignHCenter | Qt::AlignBottom, Qt::white); 
    159160    QCoreApplication::processEvents(); 
     
    211212  } 
    212213  qDebug() << "-- PCDM Session Ended --"; 
    213   if(QFile::exists("/var/run/nologin")){ neverquit = FALSE; }  
     214  if(QFile::exists("/var/run/nologin") || QFile::exists(TMPSTOPFILE) ){ neverquit = FALSE; }  
    214215 } 
    215216 return 0; 
Note: See TracChangeset for help on using the changeset viewer.