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.

36 lines
1.3 KiB

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