ModemManager: refactoring procd init script
authorFlorian Eckert <fe@dev.tdt.de>
Fri, 3 Dec 2021 14:57:33 +0000 (15:57 +0100)
committerFlorian Eckert <fe@dev.tdt.de>
Mon, 6 Dec 2021 13:49:43 +0000 (14:49 +0100)
commit0b027b131c97ec901c3b3dc9211ee434d21291dc
tree16c8336217eaf8096d6da1d5236879aa1400b753
parent4be2a5b73757eb0037d41da962518eaac4e4d3ac
ModemManager: refactoring procd init script

The way the init script is written now, we get a bad output when calling
the ubus service backend.

ubus call service list "{'verbose':true,'name':'modemmanager'}"
>{
>        "modemmanager": {
>                "instances": {
>                        "instance1": {
>                                "running": true,
>                                "pid": 20511,
>                                "command": [
>                                        "sh",
>                                        "-c",
>                                        ".
>/usr/share/ModemManager/modemmanager.common;    \t
>mkdir -m 0755 -p /var/run/modemmanager;          \t
>mm_cleanup_interfaces;                            \t
>( mm_report_events_from_cache ) >/dev/null 2>&1 & \t
>/usr/sbin/ModemManager"
>                                ],
>                                "term_timeout": 5,
>                                "respawn": {
>                                        "threshold": 3600,
>                                        "timeout": 5,
>                                        "retry": 5
>                                },
>                                "pidfile":"/var/run/modemmanager/modemmanager.pid"
>                        }
>                }
>        }
>}"

I also get the output in the log that the PID file cannot be created.

> daemon.err procd: Failed to remove pidfile: :No such file or directory

The changes in this commit fixes this issues, by moving startup into a
wrapper script.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
net/modemmanager/Makefile
net/modemmanager/files/modemmanager.init
net/modemmanager/files/usr/sbin/ModemManager-wrapper [new file with mode: 0644]