mongos.initd-r2 654 B

123456789101112131415161718192021222324252627
  1. #!/sbin/openrc-run
  2. # Copyright 1999-2014 Gentoo Foundation
  3. # Distributed under the terms of the GNU General Public License v2
  4. config_file=${config_file:-/etc/${SVCNAME}.conf}
  5. run_dir=${run_dir:-/run/mongodb}
  6. command="/usr/bin/mongos"
  7. command_args="--config ${config_file}"
  8. command_background="true"
  9. pidfile=${run_dir}/${SVCNAME}.pid
  10. user=${user:-mongodb}
  11. group=${group:-mongodb}
  12. start_stop_daemon_args="--user ${user} --group ${group}"
  13. depend() {
  14. use net
  15. }
  16. start_pre() {
  17. checkpath -d -m 0750 -o "${user}":"${group}" "${run_dir}"
  18. if [ ! -f ${config_file} ]; then
  19. eerror "Missing configuration file ${config_file}"
  20. return 1
  21. fi
  22. }