Skip to content

Commit

Permalink
feat: attempt at backward compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Gu1nness committed Jan 16, 2025
1 parent 022cade commit 3f3b796
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
6 changes: 5 additions & 1 deletion snap/local/start-mongod.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ ulimit -Sl unlimited
ulimit -SHn 64000
ulimit -SHu 64000

MONGOD_ARGS="$(snapctl get mongod-args)"
SNAP_ARGS="$(snapctl get mongod-args)"

if [ $? -eq 0 ]; then
MONGOD_ARGS=$SNAP_ARGS
fi
# For security measures, daemons should not be run as sudo. Execute mongod as the non-sudo user: snap-daemon.
exec $SNAP/usr/bin/setpriv --clear-groups --reuid snap_daemon \
--regid snap_daemon -- $SNAP/usr/bin/mongod --config ${SNAP_DATA}/etc/mongod/mongod.conf ${MONGOD_ARGS} "$@"
7 changes: 6 additions & 1 deletion snap/local/start-mongos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ ulimit -Sl unlimited
ulimit -SHn 64000
ulimit -SHu 64000

MONGOS_ARGS="$(snapctl get mongos-args)"
SNAP_ARGS="$(snapctl get mongos-args)"

if [ $? -eq 0 ]; then
MONGOS_ARGS=$SNAP_ARGS
fi

# For security measures, daemons should not be run as sudo. Execute mongos as the non-sudo user: snap-daemon.
exec $SNAP/usr/bin/setpriv --clear-groups --reuid snap_daemon \
--regid snap_daemon -- $SNAP/usr/bin/mongos ${MONGOS_ARGS} "$@"

0 comments on commit 3f3b796

Please sign in to comment.