Dual Fix: “deprecated pam_stack module” and “Unable to open env file: /etc/environment”
Catalyst posted this on Dec 1st 2008 at 6:08 am under 10.x, Ensim Fixes, Parallels Pro for Linux
/var/log/secure gets slammed with these errors every time anyone tries to connect to any service which requires authorization. The fix has been elusive, as Ensim continues to re-write the pam.d files, but running this script will take care of both issues posthaste.
Save this as /usr/local/sbin/fix_pam:
#!/bin/sh
# —————————————————————————–
#
# fix_pam ver 1.0a
#
# (c) Copyright 2007 Mark Steel / Catalyst IT. All rights reserved.
#
# This script may only be distributed unmodified.
#
# This script is intended to be used to fix the “depracated pam stack module”
# errors on servers and virtual hosts.
#
# NOTE: THIS SCRIPT IS NOT GPL
#
# —————————————————————————–
perl -i -p -e ’s/required(.*)pam_stack.so service=system-auth/include\tsystem-auth/’ /etc/pam.d/*
perl -i -p -e ’s/pam_pwdb/pam_unix/’ /etc/pam.d/*
perl -i -p -e ’s/pam_env.so$/pam_env.so readenv=0/’ /etc/pam.d/system-auth
perl -i -p -e ’s/pam_env.so$/pam_env.so readenv=0/’ /home/virtual/FILESYSTEMTEMPLATE/siteinfo/etc/pam.d/system-auth
VIRTUAL=`find /home/virtual/FILESYSTEMTEMPLATE -name pam.d`
for i in $VIRTUAL; do
perl -i -p -e ’s/required(.*)pam_stack.so service=system-auth/include\tsystem-auth/’ $i/*
perl -i -p -e ’s/pam_pwdb/pam_unix/’ $i/*
done
DOMAINS=`sitelookup -a site_root`
for i in $DOMAINS; do
perl -i -p -e ’s/required(.*)pam_stack.so service=system-auth/include\tsystem-auth/’ $i/etc/pam.d/*
perl -i -p -e ’s/pam_pwdb/pam_unix/’ $i/etc/pam.d/*
perl -i -p -e ’s/pam_env.so$/pam_env.so readenv=0/’ $i/etc/pam.d/system-auth
done
service saslauthd restart
Run once, and you’re golden.
Tip: Mark Steel @ CatalystX

crankycronos on 01 Dec 2008 at 7:08 am #
Good job. It actually works.
cepheid on 02 Feb 2009 at 4:36 am #
A reminder that this must be run after upgrading the Ensim/Parallels Pro control panel. I just upgraded from 10.3.0 to 10.3.3, and of course had to run this script again.
jorge on 10 Mar 2009 at 4:07 pm #
Thanks, it works fine.
Another line repeated endlessly is: ‘ error setting IPV6_V6ONLY: Protocol not available’ every time a FTP transfer goes underway.
Any idea on how to deal with it? there’s nothing in the web
Thanks again