You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
1.2 KiB

  1. #!/bin/sh /etc/rc.common
  2. # Copyright (C) 2016 Aleksander Morgado <aleksander@aleksander.es>
  3. USE_PROCD=1
  4. START=70
  5. LOG_LEVEL="INFO"
  6. stop_service() {
  7. # Load common utils
  8. . /usr/share/ModemManager/modemmanager.common
  9. # Set all configured interfaces as unavailable
  10. mm_cleanup_interfaces
  11. }
  12. start_service() {
  13. # Setup ModemManager service
  14. #
  15. # We will make sure that the rundir always exists, and we initially cleanup
  16. # all interfaces flagging them as unavailable.
  17. #
  18. # The cached events processing will wait for MM to be available in DBus
  19. # and will make sure all ports are re-notified to ModemManager every time
  20. # it starts.
  21. #
  22. # All these commands need to be executed on every MM start, even after
  23. # procd-triggered respawns, which is why this is wrapped in a startup
  24. # wrapper script called '/usr/sbin/ModemManager-wrapper'.
  25. #
  26. . /usr/share/ModemManager/modemmanager.common
  27. procd_open_instance
  28. procd_set_param command /usr/sbin/ModemManager-wrapper
  29. procd_append_param command --log-level="$LOG_LEVEL"
  30. [ "$LOG_LEVEL" = "DEBUG" ] && procd_append_param command --debug
  31. procd_set_param respawn "${respawn_threshold:-3600}" "${respawn_timeout:-5}" "${respawn_retry:-5}"
  32. procd_set_param pidfile "${MODEMMANAGER_PID_FILE}"
  33. procd_close_instance
  34. }