[SERVER-2210] Add repair option to rc.d/init.d script Created: 13/Dec/10  Updated: 12/Jul/16  Resolved: 25/Jan/11

Status: Closed
Project: Core Server
Component/s: Packaging
Affects Version/s: None
Fix Version/s: 1.7.5

Type: Improvement Priority: Minor - P4
Reporter: Andy Dawson Assignee: Richard Kreuter (Inactive)
Resolution: Done Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Arch linux 64


Attachments: File mongodb.diff    
Participants:

 Description   

running mongod --repair, without the same options as used via the rc.d script, isn't going to work.

Running repair therefore involves looking at the rc.d script to get the correct options. To make things easier the attached diff (against http://aur.archlinux.org/packages/mongodb/mongodb/mongodb.rc) adds repair as an option to the startup script. I didn't add removing the lock file as there is an open ticket to remove the lock file (or try to) as part of the repair process.



 Comments   
Comment by Richard Kreuter (Inactive) [ 25/Jan/11 ]

See the resolution for SERVER-1832.

Comment by Andy Dawson [ 13/Dec/10 ]

Diff inline for easier ticket skimability:

32a30,44
> repair)
> stat_busy "Repairing mongodb"
> if [ -z "$PID" ]; then
> if /bin/su mongodb -c "/usr/bin/mongod --repair --config /etc/mongodb.conf" && $0 start; then
> # Repaired and restarted
> stat_done
> else
> # Couldn't repair, or repaired and still couldn't start
> stat_fail
> fi
> else
> # Mongo is running
> stat_fail
> fi
> ;;
38c50
< echo "usage: $0

{start|stop|restart}

"

> echo "usage: $0

{start|stop|restart|repair}

"

Generated at Thu Feb 08 02:59:17 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.