From 5aa38c2e40429f06aac8bc1bc0b5ac30c5344c6f Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Tue, 24 Sep 2024 00:52:42 +0300 Subject: [PATCH] Try 6 to fix apparmor denied in syslog at Snap Candidate. Thanks to webenefits and xet7 ! Fixes #4855 --- snap-src/bin/mongodb-control | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/snap-src/bin/mongodb-control b/snap-src/bin/mongodb-control index 2dfa0ae4b..88c8258ba 100755 --- a/snap-src/bin/mongodb-control +++ b/snap-src/bin/mongodb-control @@ -114,12 +114,12 @@ if [ -z "${MONGO_URL}" ]; then #echo "mongodb log destination: ${MONGO_LOG_DESTINATION}" >> "${SNAP_COMMON}/settings.log" # Disable MongoDB telemetry and free monitoring - mongosh wekan --eval 'disableTelemetry();' --port ${MONGODB_PORT} - mongosh wekan --eval 'db.disableFreeMonitoring();' --port ${MONGODB_PORT} + /snap/${SNAP_NAME}/current/usr/bin/mongosh wekan --eval 'disableTelemetry();' --port ${MONGODB_PORT} + /snap/${SNAP_NAME}/current/usr/bin/mongosh wekan --eval 'db.disableFreeMonitoring();' --port ${MONGODB_PORT} # Snap: Disable apparmor="DENIED" at syslog # https://github.com/wekan/wekan/issues/4855 - mongosh wekan --eval 'db.adminCommand({ setParameter: 1, diagnosticDataCollectionEnabled: false});' --port ${MONGODB_PORT} + /snap/${SNAP_NAME}/current/usr/bin/mongosh wekan --eval 'db.adminCommand({ setParameter: 1, diagnosticDataCollectionEnabled: false});' --port ${MONGODB_PORT} # Drop indexes on database upgrade, when starting MongoDB #mongosh wekan --eval "db.getCollectionNames().forEach(function(col_name) { var coll = db.getCollection(col_name); coll.dropIndexes(); });" $BIND_OPTIONS @@ -128,7 +128,7 @@ if [ -z "${MONGO_URL}" ]; then #mongosh wekan --eval 'db.adminCommand({ setFeatureCompatibilityVersion: "4.4" });' ${BIND_OPTIONS} # Delete incomplete uploads so that they would not prevent starting WeKan - mongosh wekan --eval 'db.getCollection("cfs.attachments.filerecord").find( { "uploadedAt": { "$exists": true }, "copies.attachments" : null,"failures.copies.attachments.doneTrying" : {"$ne" : true}});' --port ${MONGODB_PORT} + /snap/${SNAP_NAME}/current/usr/bin/mongosh wekan --eval 'db.getCollection("cfs.attachments.filerecord").find( { "uploadedAt": { "$exists": true }, "copies.attachments" : null,"failures.copies.attachments.doneTrying" : {"$ne" : true}});' --port ${MONGODB_PORT} else @@ -148,20 +148,20 @@ else fi # Disable MongoDB telemetry and free monitoring - mongosh ${MONGO_URL} --eval 'disableTelemetry();' - mongosh ${MONGO_URL} --eval 'db.disableFreeMonitoring();' + /snap/${SNAP_NAME}/current/usr/bin/mongosh ${MONGO_URL} --eval 'disableTelemetry();' + /snap/${SNAP_NAME}/current/usr/bin/mongosh ${MONGO_URL} --eval 'db.disableFreeMonitoring();' # Snap: Disable apparmor="DENIED" at syslog # https://github.com/wekan/wekan/issues/4855 - mongosh ${MONGO_URL} --eval 'db.adminCommand({ setParameter: 1, diagnosticDataCollectionEnabled: false});' + /snap/${SNAP_NAME}/current/usr/bin/mongosh ${MONGO_URL} --eval 'db.adminCommand({ setParameter: 1, diagnosticDataCollectionEnabled: false});' # Drop indexes on database upgrade, when starting MongoDB #mongosh wekan --eval "db.getCollectionNames().forEach(function(col_name) { var coll = db.getCollection(col_name); coll.dropIndexes(); });" $BIND_OPTIONS # Set MongoDB feature compatibility version - mongosh ${MONGO_URL} --eval 'db.adminCommand({ setFeatureCompatibilityVersion: "4.4" });' + #/snap/${SNAP_NAME}/current/usr/bin/mongosh ${MONGO_URL} --eval 'db.adminCommand({ setFeatureCompatibilityVersion: "4.4" });' # Delete incomplete uploads so that they would not prevent starting WeKan - mongosh ${MONGO_URL} --eval 'db.getCollection("cfs.attachments.filerecord").find( { "uploadedAt": { "$exists": true }, "copies.attachments" : null,"failures.copies.attachments.doneTrying" : {"$ne" : true}});' + /snap/${SNAP_NAME}/current/usr/bin/mongosh ${MONGO_URL} --eval 'db.getCollection("cfs.attachments.filerecord").find( { "uploadedAt": { "$exists": true }, "copies.attachments" : null,"failures.copies.attachments.doneTrying" : {"$ne" : true}});' fi