summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaulo R. Zanoni <paulo@c3sl.ufpr.br>2008-08-26 07:00:16 -0300
committerPaulo R. Zanoni <paulo@c3sl.ufpr.br>2008-08-26 07:00:16 -0300
commitf0061902cb1801abad8fd40d53cb1929fd501942 (patch)
tree37b127db136ff8b4046b5b42ed1ca4aa3346b245
parent429c12fcd342372e70f4875a303397d16a47d615 (diff)
Revert "Loop alteration, using information given by xrandr to set new functionality,"
-rwxr-xr-xmdm/src/mdm-bin42
1 files changed, 17 insertions, 25 deletions
diff --git a/mdm/src/mdm-bin b/mdm/src/mdm-bin
index 8bf2c44..449cb65 100755
--- a/mdm/src/mdm-bin
+++ b/mdm/src/mdm-bin
@@ -25,10 +25,10 @@
MDM_PREFIX=/
MDM_SCRIPTS=${MDM_PREFIX}/usr/sbin
MDM_INCLUDE=${MDM_SCRIPTS}/mdm-common
-
source $MDM_INCLUDE
MY_LOG=${MDM_LOGS}/mdm.log
+MDM_LOCK_FILE=/var/lock/mdm.lock
CREATE_XORG_CONF=${MDM_SCRIPTS}/create-xorg-conf
START_SEAT=${MDM_SCRIPTS}/mdm-start-seat
@@ -38,11 +38,17 @@ function exec_start() {
log --log-file-only "Multiseat Display Manager version $MDM_VERSION"
log --log-file-only "Today is `date`."
+ if [ -f "$MDM_LOCK_FILE" ]; then
+ log --log-file-only "Error: mdm is already running"
+ exit 1
+ else
+ touch $MDM_LOCK_FILE
+ fi
+
# /var/run is re-created at every reboot
- mkdir -p $MDM_RUN
+ mkdir -p ${MDM_RUN}
if ([ "$RECREATE_XORG_CONF" = 'yes' ] || [ ! -f "$MDM_XORG_CONF" ]); then
- rm -f $XRANDR_INFO 2>/dev/null
$CREATE_XORG_CONF
fi
@@ -82,30 +88,14 @@ function exec_start() {
for ((i = 0; i < $SEATS; i++)); do
export DISPLAY=:0.$i
- xrandr_layout
- xrandr_resolutions
- done
-
- # Finding how many screens on each card
- SEATS_ON_CARD=(`grep "SCREEN_AMOUNT" $XRANDR_INFO | cut -d'=' -f2`)
-
- for ((i = 0; i < $SEATS; i++)); do
- export DISPLAY=:0.$i
+
# display :0.$i must press key $(i+1)
log --log-file-only "Starting seat $((i+1))"
- START_SEAT_LOG="${MDM_LOGS}/mdm-start-seat.$((i+1))"
- rotate_log $START_SEAT_LOG
-
- # The $START_SEAT has 2 parameters: the first is the card
- # on which the second is being waken.
- # The second is the seat number to be openned.
- # Remember: we can have N seats on a card with N outputs
- for (( seat=0; seat < "${SEATS_ON_CARD[i]}"; seat++)); do
- $START_SEAT $((i+1)) $((i+1+seat)) &>\
- ${START_SEAT_LOG}-$((i+1+seat)).log &
- PID=$!
- echo $PID > ${MDM_PIDS}/start-seat.$((i+1+seat)).pid
- done
+ START_SEAT_LOG="${MDM_LOGS}/mdm-start-seat.$((i+1)).log"
+ rotate_log ${START_SEAT_LOG}
+ ${START_SEAT} $((i+1)) &> ${START_SEAT_LOG} &
+ PID=$!
+ echo $PID > ${MDM_PIDS}/start-seat.$((i+1)).pid
done
fi
}
@@ -118,6 +108,8 @@ function exec_stop() {
kill `cat $i` 2> /dev/null
rm -f $i
done
+
+ rm -f $MDM_LOCK_FILE
}
function exec_reconfigure() {