[SERVER-29686] Remove /var/lib/mongodb from mongodb-org[-unstable] deb metapackage Created: 16/Jun/17  Updated: 30/Oct/23  Resolved: 07/Aug/17

Status: Closed
Project: Core Server
Component/s: Packaging
Affects Version/s: 3.5.8
Fix Version/s: 3.4.9, 3.5.12

Type: Bug Priority: Major - P3
Reporter: Ramon Fernandez Marina Assignee: Zakhar Kleyman
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Related
related to SERVER-23516 Using apt-get update chowns user to m... Closed
Backwards Compatibility: Fully Compatible
Operating System: Linux
Backport Requested:
v3.4, v3.2, v3.0
Sprint: Build 2017-07-10, Build Ready
Participants:
Case:

 Description   

The ongodb-org[-unstable] deb metapackage includes a /var/lib/mongodb directory owned by root. When installing this package, the mongodb-org[-unstable]-server package would

chown mongodb:mongodb /var/lib/mongodb

so MongoDB would run.

However, after the changes in SERVER-23516 the permissions of /var/lib/mongodb are not updated, so the resulting installation will not be usable until those permissions are fixed.

The proposed solution is to remove /var/lib/mongodb from the mongodb-org[-unstable] metapackage.



 Comments   
Comment by Ramon Fernandez Marina [ 05/Sep/17 ]

Author:

{'username': u'zakhark', 'name': u'Zakhar Kleyman', 'email': u'zakhar.kleyman@mongodb.com'}

Message:SERVER-29686 Remove /var/lib/mongodb from mongodb-org[-unstable] deb metapackage
Branch:v3.4
https://github.com/mongodb/mongo/commit/44bbb9b6aa29e66b1b54ade5e52beb4c663806be

Comment by Githook User [ 07/Aug/17 ]

Author:

{'username': 'zakhark', 'email': 'zakhar.kleyman@mongodb.com', 'name': 'Zakhar Kleyman'}

Message: SERVER-29686 Remove /var/lib/mongodb from mongodb-org[-unstable] deb metapackage
Branch: master
https://github.com/mongodb/mongo/commit/29191e637e0a7fecdadbd1dced8065858e172222

Comment by Ernie Hershey [ 20/Jun/17 ]

Ramon and I just spent some time on this. It's not clear how exactly the /var/lib/mongo directory is getting created by the metapackage. It may be difficult to stop that behavior if it's being done automatically by some deep layer of the debian package-building tools or if we can't figure out how/why it's being done.

Ramon mentioned a decent alternative fix - adding logic to the chown in the server package postinst that also chowns the directory if the owner is root instead of only chowning it if it doesn't already exist.

ubuntu@ip-10-167-91-245:~$ dpkg-deb -c mongodb-org-unstable_3.5.8_amd64.deb
drwxr-xr-x root/root         0 2017-05-30 16:24 ./
drwxr-xr-x root/root         0 2017-05-30 16:24 ./usr/
drwxr-xr-x root/root         0 2017-05-30 16:24 ./usr/bin/
drwxr-xr-x root/root         0 2017-05-30 16:24 ./usr/sbin/
drwxr-xr-x root/root         0 2017-05-30 16:24 ./usr/share/
drwxr-xr-x root/root         0 2017-05-30 16:24 ./usr/share/doc/
drwxr-xr-x root/root         0 2017-05-30 16:24 ./usr/share/doc/mongodb-org-unstable/
-rw-r--r-- root/root       483 2017-05-30 00:39 ./usr/share/doc/mongodb-org-unstable/copyright
-rw-r--r-- root/root       693 2017-05-30 16:23 ./usr/share/doc/mongodb-org-unstable/changelog.gz
drwxr-xr-x root/root         0 2017-05-30 16:24 ./var/
drwxr-xr-x root/root         0 2017-05-30 16:24 ./var/lib/
drwxr-xr-x root/root         0 2017-05-30 16:24 ./var/lib/mongodb/
ubuntu@ip-10-167-91-245:~$

Generated at Thu Feb 08 04:21:33 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.