Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

/dev/null restricted

Status
Not open for further replies.

chirpyform

Programmer
Jun 20, 2003
202
FR
Hello
I wasn't really sure which forum to post the question in.
I have a script that works perfectly well with Solaris ksh. When I changed to Linux and tried the same script I got the following error :
./rmc_ramses_fullinit.ksh[320]: /rmc/G2R1C0_java/log/20050216.090658.ramsesinit.log1: restricted
./rmc_ramses_fullinit.ksh[320]: /dev/null: restricted
./rmc_ramses_fullinit.ksh[320]: /dev/null: restricted
./rmc_ramses_fullinit.ksh[320]: /rmc/G2R1C0_java/log/20050216.090658.ramsesinit.log1: restricted
./rmc_ramses_fullinit.ksh[320]: /dev/null: restricted
./rmc_ramses_fullinit.ksh[320]: /dev/null: restricted
./rmc_ramses_fullinit.ksh[320]: /rmc/G2R1C0_java/log/20050216.090658.ramsesinit.log1: restricted

I think the error comes from the following code :

# fonction test d'enchainement
test_chaine()
{
#echo "Dans test_chaine pour $1" >>$FICLOG
if [[ -f $TEMDIR/$1.BAD ]]; then
echo "Erreur detectee dans $1, branche d execution abandonnee" >>
$FICLOG
return 1
fi
if [[ -f $TEMDIR/$1.NOX ]]; then
echo "Abandon detecte dans $1, branche d execution abandonnee" >>
$FICLOG
return 1
fi
typeset -i retstatus
while [[ (! -f $TEMDIR/$1.FIN) && (! -f $TEMDIR/$1.DBL) ]] do
relance_prof 9
ls >/dev/null 2>&1 $TEMDIR/P.[0-9].$1.PEN
retstatus=$?
if [[ (-f $TEMDIR/$1.RUN) || (-f $TEMDIR/$1.ATT) || ($retstatus -eq
0) ]]; then
# echo "$1 retarde, $SLEEP_TIME" >>$FICLOG
sleep $SLEEP_TIME
elif [[ -f $TEMDIR/$1.BAD ]]; then
echo "Erreur detectee dans $1, branche d execution
abandonnee" >>$FICLOG
return 1
elif [[ -f $TEMDIR/$1.NOX ]]; then
echo "Abandon detecte dans $1, branche d execution
abandonnee" >>$FICLOG
return 1
else
echo "Situation transitoire: absence de temoin pour $1: on
reboucle" >>$FICLOG
fi
done
#echo "Sortie de test_chaine $1" >>$FICLOG
relance_prof 9
return $2
}

flp()
{
# Donner une chance aux processus pending de priorite >= à la priorité de la
nouvelle tâche
echo "avant relance $* à $(date)" >>$FICLOG
relance_prof $1
echo "apres relance $* à $(date)" >>$FICLOG
lance_prof $*
return $?
}

# fonction de relance si possible des scripts en état "pending"
relance_prof()
{
typeset -ir mprior=${1:-9}
mv relance_en_cours relance.$mprior >/dev/null 2>&1
if [[ $? -eq 0 ]]; then
typeset -r listfic=$(cd $TEMDIR; ls 2>/dev/null *.PEN)
typeset idf
typeset -i cpucount cpri
# echo "relance_en_cours $(date)" >>$FICLOG
for idf in $listfic; do
cpu_count ; cpucount=$?
if [[ $cpucount -ge $PLIMIT ]]; then
break
fi
cpri=$(awk -vmidf=$idf 'BEGIN { split(midf,a,/[.]/); print
a[2]; }' )
# Uniquement si la priorité est inférieure au paramètre fourni
if [[ $cpri -le $mprior ]]; then
# echo "tentative de relance pour $idf à $(date) args
$(cat $TEMDIR/$idf)" >>$FICLOG
lance_prof $(cat $TEMDIR/$idf)
fi
done
# echo "fin relance en cours $(date)" >>$FICLOG
mv relance.$mprior relance_en_cours >/dev/null 2>&1
fi
return 0
}


Any ideas would be gratefully received


Chris
 
a) is /dev/null's permission world writeable / whats it
b) may be helpful to specify which lines exactly do give this
(c)) try to run it in bash, i've never seen 'restricted' messages

. Mac for productivity
.. Linux for developement
... Windows for solitaire
 
thanks for the reply

In fact the line is
(
test_chaine RMC_FONCTION_SYNC1INIT 0
flp 4 $? RMC_FONCTION_INIT_PAI.ksh
wait ) & ----- this line but i figure that this means that there is an error in the block. So i posted the functions test_chaine and flp
The file that is restricted is $FICLOG. We are able to create a file in /dev/null and copy a file there.

Chris
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top