[SERVER-7285] Support systemd in future compatible distributions Created: 05/Oct/12 Updated: 23/Nov/16 Resolved: 16/Feb/16 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Packaging, Usability |
| Affects Version/s: | 2.2.0 |
| Fix Version/s: | 3.2.9, 3.3.2 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Edouard Perov | Assignee: | Sam Kleinman (Inactive) |
| Resolution: | Done | Votes: | 17 |
| Labels: | code-only | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Fedora >= 15, RHEL7 |
||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Operating System: | ALL | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Backport Completed: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Sprint: | Build 10 (02/19/16) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Description |
|
Hello, permissions are ok for mongod user drwxr-xr-x. 2 mongod mongod 4096 Oct 5 12:41 /var/log/mongo Thanks, |
| Comments |
| Comment by Ramon Fernandez Marina [ 30/Jul/16 ] | ||||||||||||||
|
cloudkitten_, can you please open a separate ticket and provide the diff of the changes you made? That will help investigating this issue. Thanks, | ||||||||||||||
| Comment by Ewald van Geffen [ 29/Jul/16 ] | ||||||||||||||
|
I experience problems on CentOS7 with the sysvinit compability generators. As quickfix I simply copied the broken systemd generated file and manually fixed and copied it into the right place. The problem was with over 100 PHP-FPM pools the After= statement would be so long it somehow resulted strange issues.
I feel it's better if we can provide native upstart files. Contact me if you need more additional information as this is very much reproducible. | ||||||||||||||
| Comment by Githook User [ 15/Jul/16 ] | ||||||||||||||
|
Author: {u'username': u'tychoish', u'name': u'Sam Kleinman', u'email': u'samk@10gen.com'}Message: (cherry picked from commit f7414114d89d7c07ee1f2282290897ddbd27985c) | ||||||||||||||
| Comment by Githook User [ 13/Jun/16 ] | ||||||||||||||
|
Author: {u'username': u'tychoish', u'name': u'Sam Kleinman', u'email': u'samk@10gen.com'}Message: (cherry picked from commit 6f01e1c7555e39e3618953c3fc0a5c5c216be09b) | ||||||||||||||
| Comment by Kanstantsin Shautsou [ 07/Jun/16 ] | ||||||||||||||
http://www.rpm.org/max-rpm/s1-rpm-inside-scripts.html#S3-RPM-INSIDE-PREUN-SCRIPT and https://fedoraproject.org/wiki/Packaging:Scriptlets | ||||||||||||||
| Comment by Githook User [ 16/Feb/16 ] | ||||||||||||||
|
Author: {u'username': u'tychoish', u'name': u'Sam Kleinman', u'email': u'samk@10gen.com'}Message: | ||||||||||||||
| Comment by Sam Kleinman (Inactive) [ 11/Feb/16 ] | ||||||||||||||
|
After a thorough review of our own packaging infrastructure and the recommendations in packaging guidelines I have a couple of comments regarding this case:
Based on this I'm going to go ahead and close this ticket, thanks for your patience! | ||||||||||||||
| Comment by Githook User [ 09/Feb/16 ] | ||||||||||||||
|
Author: {u'username': u'tychoish', u'name': u'Sam Kleinman', u'email': u'samk@10gen.com'}Message: | ||||||||||||||
| Comment by Alex [ 07/Dec/15 ] | ||||||||||||||
|
systemd is now the default even on Debian 8 | ||||||||||||||
| Comment by Ernie Hershey [ 25/Mar/15 ] | ||||||||||||||
|
andreibarsan we're working to prioritize this. You're right that systemd is becoming the default in more and more places and the sooner we improve our support for it the easier it will make using MongoDB on those distributions. octoquad - we'll probably have additional issues to work through before our packages work in Ubuntu 15.04. I've created a separate ticket to track that work - | ||||||||||||||
| Comment by Bruce Pieterse [ 24/Mar/15 ] | ||||||||||||||
|
To extend on Andrei Barsan's comment, Ubuntu Vivid Vervet (15.04) has made the switch to systemd a few weeks back. As a tester for Ubuntu Gnome, I upgraded earlier to catch any distribution upgrade bugs from 14.10. Unfortunately this also rendered my installation of MongoDB 2.6.x with the instructions followed here: http://docs.mongodb.org/v2.6/tutorial/install-mongodb-on-ubuntu/ now unusable: » sudo service mongod start » systemctl start mongod If I need to file a seperate report for this, please let me know. Thanks | ||||||||||||||
| Comment by Andrei Barsan [ 06/Mar/15 ] | ||||||||||||||
|
Any news regarding this issue? There are already many Linux server distros which use systemd by default, such as Fedora, RHEL, OpenLogic and CentOS. | ||||||||||||||
| Comment by Githook User [ 11/Aug/14 ] | ||||||||||||||
|
Author: {u'username': u'mikemaccana', u'name': u'Mike MacCana', u'email': u'mike.maccana@gmail.com'}Message: Add a systemd .service file. This is used in place of System V init scripts on most current Linux distributions. Closes #740 Signed-off-by: Benety Goh <benety@mongodb.com> | ||||||||||||||
| Comment by Ernie Hershey [ 11/Jul/14 ] | ||||||||||||||
|
FWIW - I just verified that on a stock rhel 7.0 machine with systemd, our community RPM with non-systemd init script installs cleanly and lets you control the service via the 'service' command, according to the standard docs here - http://docs.mongodb.org/manual/tutorial/install-mongodb-on-red-hat-centos-or-fedora-linux/ | ||||||||||||||
| Comment by Tim Hawkins [ 28/Dec/12 ] | ||||||||||||||
|
The fix i have given only really works for a standard default install, if the user reconfigures the server to have its data-files in a different place, the problem will resurface. Im not sure how best to fix this, putting the pid file into a fixed place like /var/run/mongod.pid would cause problems with multiple instances, which are quite common on mongo installations. Perhaps having the init.d script set the pid path by the command-line setting, as /var/run/mongod.pid, is acceptable, so folks can set the datadir to whatever they like via the conf file, so long as documentation is made available for troubleshooting if it should stall. The problem is really in systemd, it should never stall, and should time out with a suitable error message. The fact that you can get you system into a non bootable state with this is not good. | ||||||||||||||
| Comment by Angel Rivera [ 27/Dec/12 ] | ||||||||||||||
|
Tim I can confirm your fix works. I just had this same issue with my new Fedora install. I changed the commented line to pidfile: /var/lib/mongo/mongod.lock and ran the sudo systemctl --system daemon-reload command and it fixed the issue. I downloaded the mongodb 2.2.2 from the 10gen repos using yum and the boot problem occurred immediately after I rebooted. | ||||||||||||||
| Comment by Tim Hawkins [ 04/Dec/12 ] | ||||||||||||||
|
I'm not sure where this issue is coming from, but my experiences while not ideal are quite different on Fedora 17 I have alsways installed all my copies of Mongo on F16 and F17 from the mongodb Repo using "yum install mongo-10gen mongo-10gen-server" There IS a failure mode, but for me its not related to permissions, systemd when presented with a new init.d script, reads the script and creates the systemd unit file automaticaly. The mongod init.d script has an incorrect pidfile path which points to a non-existant pidfile. changing this comment to (for the default install)
and rerunning sudo systemctl --system daemon-reload causes systemd to reimport the init.d script and rebuild the systemd unit file. So now systemd can find the mongod.lock file which contains the running server pid. Without this two things will happen. 1. Starting mongod with will stall, as its waiting for the pid file to be created, mongod actualy starts up, but the command never returns. 2. If you have executed to get mongo to startup at boot, then your system will hard hang on restart, and you will have to use the emergency console to recover your system. | ||||||||||||||
| Comment by Mark porter [ 11/Oct/12 ] | ||||||||||||||
|
Hi Edouard, Thanks for your update and that's what I thought and explains why 2.0.7 works via "service". I will update this ticket with our progress. Thanks Mark | ||||||||||||||
| Comment by Edouard Perov [ 10/Oct/12 ] | ||||||||||||||
|
Hi Mark, | ||||||||||||||
| Comment by Mark porter [ 10/Oct/12 ] | ||||||||||||||
|
Hi Edouard, I believe that in Fedora 15, Red Hat switched from upstart to systemd as the default init replacement. None of our RPMs support systemd and I believe that your issue has been a problem for quite some time. I suspect that this may not have come up before because most folk use the EPEL repo, which does the correct thing whereas ours doesn't. EPEL do not have 2.2 in their repo yet as far as I know. Can I confirm the you installed MongoDB 2.0.7 from our repo or from another repo? If the supposition that I have detailed above is correct, we do not believe that the fix is trivial so we are currently discussing what is best to do regarding a solution. Thanks Mark | ||||||||||||||
| Comment by Edouard Perov [ 10/Oct/12 ] | ||||||||||||||
|
Hi Mark, | ||||||||||||||
| Comment by Mark porter [ 09/Oct/12 ] | ||||||||||||||
|
Hi Edouard, I can reproduce your issue. I am still investigating and will update you with more details as soon as I have something more detailed. Thanks Mark | ||||||||||||||
| Comment by Gianfranco Palumbo [ 09/Oct/12 ] | ||||||||||||||
|
So it was working on 2.0.7 ? Can you check the permission for your data file directory as well as post the /etc/mongod.conf? | ||||||||||||||
| Comment by Edouard Perov [ 07/Oct/12 ] | ||||||||||||||
|
I have found that strafing like this works: starting via service does not. | ||||||||||||||
| Comment by Edouard Perov [ 06/Oct/12 ] | ||||||||||||||
|
Installed 2.2.0 back and providing snapshots to show that I start it as root as the official note recommends UNIX> service mongod start This is my screen snapshot 1. List of installed mongodb RPMs 2. Current user - root 3. Start server Oct 06 10:23:10 Evkalipt runuser[2098]: pam_unix(runuser:session): session opened for user mongod by (uid=0) 5. List/owners/permissions of the directories [root@Evkalipt ~]# ls -al /var//mong /var/log/mongo: | ||||||||||||||
| Comment by Edouard Perov [ 06/Oct/12 ] | ||||||||||||||
|
Yes, I start it as root. Might be /var/log/mongodb is "hardcoded" in 2.2.0 but it does on exist. | ||||||||||||||
| Comment by Eliot Horowitz (Inactive) [ 06/Oct/12 ] | ||||||||||||||
|
The error is relatively clear, so are you sure you're starting mongo as the right user? |