1
0
mirror of https://git.openwrt.org/feed/packages.git synced 2024-06-13 19:03:52 +02:00
openwrt-packages/utils/smstools3/patches/004-modem-processes.patch
Harald Geyer 0cc76f89ae smstools3: Move init script to use procd
* properly install config file
* prevent smsd from starting right after installation to prevent loss of data
  (make default device unavailable by turning configuration into comments)
* move init script to procd
* update init script priority to sane value
* log to syslog - at the moment via stdout and procd
  this is a workaround to force smsd to stay in the foreground
* the init script can't do a modem reset anymore
  use an alarmhandler script instead
* add a local patch to make all processes terminate if the main process dies
* take over the package as new maintainer

Signed-off-by: Harald Geyer <harald@ccbib.org>
2018-03-06 14:17:14 +00:00

27 lines
769 B
Diff

commit 3790bd05ed86b1692719df22857ef76c1293b01c
Author: Harald Geyer <harald@ccbib.org>
Date: Sun Feb 18 19:24:48 2018 +0100
Make modem processes terminate when main process dies
diff --git a/src/smsd.c b/src/smsd.c
index fdfa193..37b2e4d 100755
--- a/src/smsd.c
+++ b/src/smsd.c
@@ -34,6 +34,7 @@ Either version 2 of the License, or (at your option) any later version.
#ifndef DISABLE_INOTIFY
#include <sys/inotify.h>
#endif
+#include <sys/prctl.h>
#include "extras.h"
#include "locking.h"
@@ -8100,6 +8101,7 @@ int main(int argc,char** argv)
if (pid == 0)
{
+ prctl(PR_SET_PDEATHSIG, SIGTERM, 0, 0, 0);
process_id = i;
strcpy(process_title, DEVICE.name);
apply_process_name(argc, argv, process_title);