summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--debian/bcfg2.default6
-rw-r--r--debian/bcfg2.init76
-rw-r--r--man/bcfg2.conf.54
-rw-r--r--src/lib/Client/Tools/POSIX.py3
4 files changed, 13 insertions, 76 deletions
diff --git a/debian/bcfg2.default b/debian/bcfg2.default
index 03ecdfbd4..0164e5531 100644
--- a/debian/bcfg2.default
+++ b/debian/bcfg2.default
@@ -20,11 +20,7 @@
#BCFG2_INIT=1
# BCFG2_AGENT:
-# Run Bcfg2 in Agent mode at system bootup
-#
-# Set value to 1 to enable
-# Default: 0 (disable)
-#BCFG2_AGENT=1
+# Bcfg2 no longer supports agent mode please use the Agent+SSH method
# BCFG2_CRON:
# Set the frequency of cron runs.
diff --git a/debian/bcfg2.init b/debian/bcfg2.init
index 76adf0ad4..add840c90 100644
--- a/debian/bcfg2.init
+++ b/debian/bcfg2.init
@@ -38,26 +38,21 @@ test -f "/etc/default/bcfg2" && . /etc/default/bcfg2
[ "$BCFG2_AGENT" -eq 0 -a "$BCFG2_INIT" -eq 0 ] && exit 0
# Exit if bcfg2 doesn't exist and is not executable
-test -x $BCFG2 || exit 5
+test -x $BCFG2 || exit 0
+
+if [ "$BCFG2_AGENT" != 0 ]; then
+ echo "Bcfg2 no longer supports agent mode, please update your configuration!"
+ exit 1
+fi
-# Agent mode daemon capability
-PIDFILE=/var/run/bcfg2-agent.pid
# Internal variables
BINARY=$(basename $BCFG2)
-AGENT_EXTRA_OPTS="-A -i ${PIDFILE}"
-
# Include lsb functions
. /lib/lsb/init-functions
start () {
echo -n "Running configuration management client: "
- if [ "$BCFG2_AGENT" -eq 1 ]
- then
- start_daemon ${BCFG2} ${AGENT_EXTRA_OPTS} ${BCFG2_OPTIONS} ${BCFG2_OPTIONS_AGENT}
- STATUS=$?
- fi
-
if [ "$BCFG2_INIT" -eq 1 ]; then
${BCFG2} ${BCFG2_OPTIONS} ${BCFG2_OPTIONS_INIT}
STATUS=$?
@@ -66,75 +61,24 @@ start () {
if [ "$STATUS" -eq 0 ]
then
log_success_msg "bcfg2"
- if [ "$BCFG2_AGENT" -eq 1 ]; then
- test -d /var/lock/subsys && touch /var/lock/subsys/bcfg2-agent
- fi
else
log_failure_msg "bcfg2"
fi
return $STATUS
}
-status () {
- if [ "$BCFG2_AGENT" -eq 1 ]
- then
- PID=$(pidof -x $BINARY)
- if [ -n "$PID" ] ; then
- log_success_msg "$BINARY (pid $PID) is running..."
- return 0
- fi
- if [ -f $PIDFILE ]; then
- if [ -n "$PID" ]; then
- log_failure_msg "$BINARY dead but pid file exists..."
- return 1
- fi
- fi
- else
- return 0
- fi
-}
-
-stop () {
- if [ "$BCFG2_AGENT" -eq 1 ]
- then
- echo -n "Stopping configuration management client daemon: "
- killproc -p $PIDFILE ${BINARY}
- STATUS=$?
- if [ "$STATUS" -eq 0 ]
- then
- log_success_msg "bcfg2"
- if [ "$BCFG2_AGENT" -eq 1 ]; then
- test -d /var/lock/subsys && rm -f /var/lock/subsys/bcfg2-agent
- fi
- else
- log_failure_msg "bcfg2"
- fi
- return $STATUS
- else
- return 0
- fi
-}
-
case "$1" in
start)
start
;;
stop)
- stop
- ;;
- status)
- status
+ exit 0
;;
- restart|reload|force-reload)
- if [ "$BCFG2_AGENT" -eq 1 ]
- then
- stop
- sleep 5
- start
- fi
+ restart|force-reload)
+ start
;;
*)
- echo "Usage: $0 {start|stop|restart|reload|force-reload|status}"
+ echo "Usage: $0 {start|stop|restart|force-reload}"
exit 1
esac
diff --git a/man/bcfg2.conf.5 b/man/bcfg2.conf.5
index 015ab7c0e..ec8c154a2 100644
--- a/man/bcfg2.conf.5
+++ b/man/bcfg2.conf.5
@@ -237,10 +237,6 @@ Port for database connections. Not used for sqlite3.
Specified in the [communication] section. These options define settings used for client-server communication.
.TP
-.B agent-port
-The TCP port on which to bind for agent mode.
-
-.TP
.B ca
The path to a file containing the CA certificate. This file is required on the server, and optional on clients. However, if the cacert is not present on clients, the server cannot be verified.
diff --git a/src/lib/Client/Tools/POSIX.py b/src/lib/Client/Tools/POSIX.py
index ac9059517..8fc07dd60 100644
--- a/src/lib/Client/Tools/POSIX.py
+++ b/src/lib/Client/Tools/POSIX.py
@@ -7,6 +7,7 @@ from stat import S_IWGRP, S_IRGRP, S_IXOTH, S_IWOTH, S_IROTH, ST_MODE, S_ISDIR
from stat import S_IFREG, ST_UID, ST_GID, S_ISREG, S_IFDIR, S_ISLNK, ST_MTIME
import binascii
import difflib
+import errno
import grp
import logging
import os
@@ -688,7 +689,7 @@ class POSIX(Bcfg2.Client.Tools.Tool):
return False
return True
except (OSError, IOError), err:
- if err.errno == 13:
+ if err.errno == errno.EACCES:
self.logger.info("Failed to open %s for writing" % (entry.get('name')))
else:
print(err)