CASA.spec was corrected and pam scripts were moved to spec file instead of start up script.
This commit is contained in:
25
c_micasad/startup/casacfgpam
Executable file
25
c_micasad/startup/casacfgpam
Executable file
@@ -0,0 +1,25 @@
|
||||
# Adding CASA pam entries to pam files.
|
||||
for pam_file in "/etc/pam.d/login" "/etc/pam.d/sshd" "/etc/pam.d/xdm" "/etc/pam.d/gdm" "/etc/pam.d/kdm"
|
||||
do
|
||||
if [ -f $pam_file ]
|
||||
then
|
||||
MICASA_D=`grep -i pam_micasa $pam_file`
|
||||
if [ -z "$MICASA_D" ]
|
||||
then
|
||||
awk '
|
||||
/auth/ { authSeen++; }
|
||||
/account/ {
|
||||
if (!acctSeen && authSeen)
|
||||
{
|
||||
print "auth\trequired\tpam_micasa.so\n";}
|
||||
acctSeen++;
|
||||
}
|
||||
/session/ { sesSeen++; }
|
||||
// {print $0; }
|
||||
END { if (sesSeen)
|
||||
print "session\trequired\tpam_micasa.so\n"; }
|
||||
' $pam_file > $pam_file.sav
|
||||
mv $pam_file.sav $pam_file
|
||||
fi
|
||||
fi
|
||||
done
|
||||
9
c_micasad/startup/casaucfgpam
Normal file
9
c_micasad/startup/casaucfgpam
Normal file
@@ -0,0 +1,9 @@
|
||||
# Remove the CASA pam entries from pam files.
|
||||
for pam_file in "/etc/pam.d/login" "/etc/pam.d/sshd" "/etc/pam.d/xdm" "/etc/pam.d/gdm" "/etc/pam.d/kdm"
|
||||
do
|
||||
if [ -f $pam_file ]
|
||||
then
|
||||
sed -i '/pam_micasa/d' $pam_file
|
||||
fi
|
||||
done
|
||||
|
||||
@@ -30,51 +30,22 @@ rc_reset
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
echo -n "Starting miCASA daemon"
|
||||
for pam_file in "/etc/pam.d/login" "/etc/pam.d/sshd" "/etc/pam.d/xdm" "/etc/pam.d/gdm" "/etc/pam.d/kdm"
|
||||
do
|
||||
if [ -f $pam_file ]
|
||||
then
|
||||
MICASA_D=`grep -i micasad $pam_file`
|
||||
if [ -z "$MICASA_D"]
|
||||
then
|
||||
awk '
|
||||
/auth/ { authSeen++; }
|
||||
/account/ {
|
||||
if (!acctSeen && authSeen)
|
||||
{
|
||||
print "auth\trequired\tpam_micasa.so";}
|
||||
acctSeen++;
|
||||
}
|
||||
/session/ { sesSeen++; }
|
||||
// {print $0; }
|
||||
END { if (sesSeen)
|
||||
print "session\trequired\tpam_micasa.so"; }
|
||||
' $pam_file > $pam_file.sav
|
||||
mv $pam_file.sav $pam_file
|
||||
fi
|
||||
fi
|
||||
done
|
||||
startproc -f $MICASAD_BIN
|
||||
# Remember status and be verbose
|
||||
rc_status -v
|
||||
;;
|
||||
echo -n "Starting miCASA daemon"
|
||||
startproc -f $MICASAD_BIN
|
||||
# Remember status and be verbose
|
||||
rc_status -v
|
||||
;;
|
||||
|
||||
stop)
|
||||
echo -n "Shutting miCASA daemon down"
|
||||
#killproc -TERM $MICASAD_BIN
|
||||
echo -n "Shutting miCASA daemon down"
|
||||
#killproc -TERM $MICASAD_BIN
|
||||
pid=`cat /var/run/micasad.pid`
|
||||
kill -s TERM $pid
|
||||
|
||||
for pam_file in "/etc/pam.d/login" "/etc/pam.d/sshd" "/etc/pam.d/xdm" "/etc/pam.d/gdm" "/etc/pam.d/kdm"
|
||||
do
|
||||
if [ -f $pam_file ]
|
||||
then
|
||||
sed -i '/pam_micasa/d' $pam_file
|
||||
fi
|
||||
done
|
||||
# Remember status and be verbose
|
||||
rc_status -v
|
||||
;;
|
||||
# Remember status and be verbose
|
||||
rc_status -v
|
||||
;;
|
||||
|
||||
restart)
|
||||
## Stop the service and regardless of whether it was
|
||||
## running or not, start it again.
|
||||
|
||||
Reference in New Issue
Block a user