Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

235
Views
Disable MongoDB restart on upgrade (RPM package)

MongoDB RPM packages (provided by official repo.mongodb.org repository, as of version 3.4.1) automatically and unconditionally restart server on package upgrade. This behaviour is hardcoded into postun handler:

if test $1 -ge 1                                                                                                                                                                                                    
then                                                                                                                                                                                                                
  /usr/bin/systemctl restart mongod >/dev/null 2>&1 || :                                                                                                                                                            
fi

This is an inconvenient and dangerous behaviour, especially when you use configuration management tools to set up your servers. For example, I'd like to run a full Ansible playbook to set up my servers first, and then restart MongoDB manually one by one to have full control of the situation.

Is there any way to alter or disable this? Alternative MongoDB packages, maybe? Or some obscure yum/rpm command option to disable scriptlets?

I'm aware that I can switch to simple .tar.gz installation, but this is the last resort.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

If you first download the rpm and install it manually using rpm; you can use the --nopostun option:

rpm -Uvh mongodb***rpm --nopostun

from the rpm man page:

  --noscripts
  --nopre
  --nopost
  --nopreun
  --nopostun
  --nopretrans
  --noposttrans
         Don't execute the scriptlet of the same name.  The --noscripts option is equivalent to
         --nopre --nopost --nopreun --nopostun --nopretrans --oposttrans
         and turns off the execution of the corresponding %pre, %post, %preun, %postun %pretrans, and %posttrans scriptlet(s).

afaik yumcannot handle the --nopostun and other flags.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!