LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   weird login problem (https://www.linuxquestions.org/questions/linux-software-2/weird-login-problem-166616/)

nmayotte 04-05-2004 06:47 PM

weird login problem
 
This may end up being a scripting question, so I wasn't sure if it should go here or in the programming forum. But here goes... Sometimes when users try to log into a machine they can type their username and password in, then the screen goes black and then the login splash screen appears again, and then they can login normally. This has only happened on a couple machines, which are hardware and software identical to a dozen others that haven't had problems. They run SuSE 8.2. My hunch is that the problem is in these two nanny scripts that I have running, but I am not sure. I haven't been able to replicate the problem for me, even by running the scripts by hand. Does anyone have any ideas what could cause this or where to look to try to fix it? I can post the two scripts that I'm suspicious of if anyone wants to try to decipher them to see if they could be the root of the problem.

BigNate 04-05-2004 08:27 PM

That does sound pretty strange...post the scripts, and that way we can look at them. Also, have these machines always behaved this way or is this a new problem?

nmayotte 04-07-2004 01:56 PM

I think, this has been going on since I imaged the machines in the fall, altough I've only just heard about it recently.

First one:

#!/bin/sh

# This script is designed to nanny a daemon. It can be run from cron and it wil
l restart a daemon if it has determined that the daemon has died.
#

PS_MATCH=postfix
RESTART="/etc/rc.d/postfix start"

PS_OUT=`/bin/ps -e -f | grep $PS_MATCH | grep -v nanny | grep -v root`
echo $PS_OUT > /tmp/nanny2.tmp
WC_OUT=`/usr/bin/wc -c /tmp/nanny2.tmp | awk -F"/" '{print $1}' | sed s/" "//g`

if [ $WC_OUT -lt 2 ]
then
PS_OUT2=`/bin/ps -e -f | grep $PS_MATCH | grep -v nanny | grep -v root
`
echo $PS_OUT2 > /tmp/nanny2.tmp
WC_OUT2=`/usr/bin/wc -c /tmp/nanny2.tmp | awk -F"/" '{print $1}' | sed
s/" "//g`
if [ $WC_OUT2 -lt 2 ]
then
$RESTART
echo "will restart"
else
echo "is running"
fi
else
echo "is running-1st"
fi


Second one:

#!/bin/sh

# This script is designed to nanny a daemon. It can be run from cron and it wil
l restart a daemon if it has determined that the daemon has died.
#

PS_MATCH=rpc.statd
RESTART=/sbin/rpc.statd

PS_OUT=`/bin/ps -e -f | grep $PS_MATCH | grep -v grep`
echo $PS_OUT > /tmp/nanny.tmp
WC_OUT=`/usr/bin/wc -c /tmp/nanny.tmp | awk -F"/" '{print $1}' | sed s/" "//g`

if [ $WC_OUT -lt 2 ]
then
PS_OUT2=`/bin/ps -e -f | grep $PS_MATCH | grep -v grep`
echo $PS_OUT2 > /tmp/nanny2.tmp
WC_OUT2=`/usr/bin/wc -c /tmp/nanny2.tmp | awk -F"/" '{print $1}' | sed
s/" "//g`
if [ $WC_OUT2 -lt 2 ]
then
$RESTART
echo "will restart"
else
echo "is running"
fi
else
echo "is running-1st"
fi


All times are GMT -5. The time now is 02:39 AM.