Skip to content
Browse files

Updates

  • Loading branch information...
1 parent 21e408d commit 68ba09b375f5072a39d8791e2954ffdfcb561ba4 @sjvermeu committed
View
29 fileproc/fileprocctl
@@ -15,6 +15,28 @@ then
exit 1;
fi
+removeAllStates() {
+ RULE="$1";
+ RUNDIR=$(getSetting rundir);
+
+ for FILE in $(find ${RUNDIR} -type f -name *.${RULE}.run);
+ do
+ FILENAME=$(echo ${FILE} | sed -e "s:${RUNDIR}::g" | sed -e "s:.${RULE}.run$::g");
+ if [ -f ${FILE%%run}pid ];
+ then
+ echo "Skipping ${FILENAME} state as it has not completed yet.";
+ continue;
+ fi
+ grep 'state=finished' ${FILE} > /dev/null 2>&1;
+ if [ $? -ne 0 ];
+ then
+ echo "Skipping ${FILENAME} state as it did not end succesfully.";
+ continue;
+ fi
+ rm ${FILE};
+ done
+}
+
listRunStates() {
RUNDIR=$(getSetting rundir);
RULESDIR=$(getSetting rulesdir);
@@ -49,6 +71,9 @@ Usage: $0 reset <filename> <rule>;
fileprocmon is complaining but the source file does not exist
anymore
+ $0 removeall <rule>
+ Remove all runstates pertaining to the selected rule.
+
$0 list
List all runstates.
@@ -93,6 +118,10 @@ case "${COMMAND}" in
fi
rm ${RUNDIR}/${FILENAME}.${RULENAME}.run;
;;
+ "removeall")
+ RULENAME="$1";
+ removeAllStates ${RULENAME};
+ ;;
"list")
listRunStates;
;;
View
2 fileproc/fileprocmon
@@ -33,7 +33,7 @@ do
## Missing state=finished in runfile -> execution killed?
grep 'state=finished' ${FILE} > /dev/null 2>&1;
- if [ $? -ne 0 ];
+ if [ $? -ne 0 ] && [ ! -f ${PIDFILE} ];
then
SCRIPT=$(awk -F'=' '/runscript=/ {print $2}' ${FILE});
FILENAME=$(awk -F'=' '/filename=/ {print $2}' ${FILE});
View
9 gensetup/master.lib.sh
@@ -244,10 +244,10 @@ setOrUpdateQuotedVariable() {
TESTER="[ ]";
fi
- grep "^${VARIABLE}${TESTER}" ${FILE} > /dev/null 2>&1;
+ grep "^[ ]*${VARIABLE}${TESTER}" ${FILE} > /dev/null 2>&1;
if [ $? -eq 0 ];
then
- sed -i -e "s|^${VARIABLE}${TESTER}.*|${VARIABLE}${SPACER}\"${VALUE}\"|g" ${FILE};
+ sed -i -e "s|^\([ ]*\)${VARIABLE}${TESTER}.*|\1${VARIABLE}${SPACER}\"${VALUE}\"|g" ${FILE};
else
echo "${VARIABLE}${SPACER}\"${VALUE}\"" >> ${FILE};
fi
@@ -266,10 +266,11 @@ setOrUpdateUnquotedVariable() {
TESTER="[ ]";
fi
- grep "^${VARIABLE}${TESTER}" ${FILE} > /dev/null 2>&1;
+ grep "^[ ]*${VARIABLE}${TESTER}" ${FILE} > /dev/null 2>&1;
if [ $? -eq 0 ];
then
- sed -i -e "s|^${VARIABLE}${TESTER}.*|${VARIABLE}${SPACER}${VALUE}|g" ${FILE};
+ # Preserve indentation
+ sed -i -e "s|^\([ ]*\)${VARIABLE}${TESTER}.*|\1${VARIABLE}${SPACER}${VALUE}|g" ${FILE};
else
echo "${VARIABLE}${SPACER}${VALUE}" >> ${FILE};
fi
View
1 gensetup/setups/ldap1.conf
@@ -16,6 +16,7 @@ openldap.slapd.db.rootdn=cn=Manager,dc=virtdomain,dc=com
openldap.slapd.db.directory=/var/lib/openldap-ldbm
openldap.slapd.syncrepl.provider=ldap://ldap2.virtdomain.com
openldap.slapd.syncrepl.binddn=cn=ldap1.virtdomain.com,ou=Hosts,dc=virtdomain,dc=com
+openldap.slapd.serverID=001
openldap.ldap.BASE=dc=virtdomain,dc=com
openldap.ldap.URI=ldap://ldap.virtdomain.com:389/
openldap.ldap.TLS_REQCERT=allow
View
3 gensetup/setups/ldap2.conf
@@ -15,7 +15,8 @@ openldap.slapd.db.suffix=dc=virtdomain,dc=com
openldap.slapd.db.rootdn=cn=Manager,dc=virtdomain,dc=com
openldap.slapd.db.directory=/var/lib/openldap-ldbm
openldap.slapd.syncrepl.provider=ldap://ldap1.virtdomain.com
-openldap.slapd.syncrepl.binddn=cn=ldap2.virtdomain.com,ou=Hosts,dc=virtdomain,dc=com
+openldap.slapd.syncrepl.binddn=cn=ldapreader,dc=virtdomain,dc=com
+openldap.slapd.serverID=002
openldap.ldap.BASE=dc=virtdomain,dc=com
openldap.ldap.URI=ldap://ldap.virtdomain.com:389/
openldap.ldap.TLS_REQCERT=allow
View
13 gensetup/setups/setup_ldap.sh
@@ -98,7 +98,7 @@ include /etc/openldap/schema/misc.schema
pidfile /var/run/openldap/slapd.pid
argsfile /var/run/openldap/slapd.args
-serverID 001
+serverID SERVERID
loglevel 0
## Access Controls
@@ -120,13 +120,13 @@ index objectClass eq
## Synchronisation (pull from other)
syncrepl rid=000
- provider=ldap://ldap2.virtdomain.com
+ provider=ldap://PROVIDER.virtdomain.com
type=refreshAndPersist
retry="5 5 300 +"
searchbase="dc=virtdomain,dc=com"
attrs="*,+"
bindmethod="simple"
- binddn="cn=ldap.virtdomain.com,dc=virtdomain,dc=com"
+ binddn="cn=ldapreader.virtdomain.com,dc=virtdomain,dc=com"
credentials="ldapsyncpass"
index entryCSN eq
@@ -140,6 +140,7 @@ EOF
updateWhitespaceConfFile openldap.slapd.db ${FILE};
updateWhitespaceConfFile openldap.slapd.syncrepl ${FILE};
setOrUpdateQuotedVariable rootpw " " "${LDAPPASS}" ${FILE};
+ setOrUpdateUnquotedVariable serverID " " $(getValue openldap.slapd.serverID) ${FILE};
applyMetaOnFile ${FILE} ${META};
commitChangeFile ${FILE} ${META};
logMessage "done\n";
@@ -203,12 +204,8 @@ setupldap() {
logMessage " ! remember, basedn is the dc=..,dc=.. part.\n";
logMessage " ! rootdn is the cn=..,dc=..,dc=.. part.\n";
logMessage " !\n";
- logMessage " ! Next, disable SELinux temporarily (need to read shadow)\n";
- logMessage " ! Run \"grep 100 /etc/passwd > passwd.ldap\"\n";
- logMessage " ! Run \"ETC_SHADOW=/etc/shadow ./migrate_passwd.pl ./passwd.ldap > passwd.ldif\"\n";
- logMessage " ! Update passwd.ldif (substitute rootdn).\n";
+ logMessage " ! Create ldif for ldapreader.\n";
logMessage " ! Run ldapadd -x -D \"cn=...\" -W -f ./passwd.ldif\n";
- logMessage " ! Also validate the synchronisation, set a password on the host, might want to add simpleSecurityObject etc.\n";
die "When finished, continue with step setuppam."
}
View
0 gensetup/setups/www.conf → gensetup/setups/www1.conf
File renamed without changes.
View
8 gensetup/setups/www2.conf
@@ -0,0 +1,8 @@
+conf.net.config_eth0=( "192.168.100.62/24" )
+conf.net.routes_eth0=( "default via 192.168.100.1" )
+conf.hostname.HOSTNAME=www2
+sys.resolv.search=virtdomain.com
+sys.resolv.nameservers=192.168.100.71 192.168.100.72
+sys.hosts=192.168.100.62 www2.virtdomain.com www2
+sys.makeconf.PORTAGE_BINHOST=http://192.168.100.50/packages
+php.date_timezone=Europe/Brussels

0 comments on commit 68ba09b

Please sign in to comment.
Something went wrong with that request. Please try again.