The sender domain has a DMARC Reject/Quarantine policy which disallows
sending mailing list messages using the original "From" header.

To mitigate this problem, the original message has been wrapped
automatically by the mailing list software.
--- Begin Message ---
Introduce -I and -R arguments that can be used to override the paths
/etc/init.d and /etc/rc.d, allowing for some runlevel-like usecases.

This will replace a downstream patch in Gluon [1] needed to support a
'config mode'.

[1] https://github.com/freifunk-gluon/gluon

Signed-off-by: Nora Matthias Schiffer <[email protected]>
---
 procd.c | 10 +++++++++-
 procd.h |  3 +++
 rcS.c   |  7 +++++--
 3 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/procd.c b/procd.c
index 1223283..46ba680 100644
--- a/procd.c
+++ b/procd.c
@@ -83,6 +83,8 @@ static int usage(const char *prog)
                "       -s <path>       Path to ubus socket\n"
                "       -h <path>       run as hotplug daemon\n"
                "       -d <level>      Enable debug messages\n"
+               "       -I <path>       Path to init.d directory\n"
+               "       -R <path>       Path to rc.d directory\n"
                "       -S              Print messages to stdout\n"
                "\n", prog);
        return 1;
@@ -99,7 +101,7 @@ int main(int argc, char **argv)
                unsetenv("DBGLVL");
        }
 
-       while ((ch = getopt(argc, argv, "d:s:h:S")) != -1) {
+       while ((ch = getopt(argc, argv, "d:s:h:I:R:S")) != -1) {
                switch (ch) {
                case 'h':
                        return hotplug_run(optarg);
@@ -109,6 +111,12 @@ int main(int argc, char **argv)
                case 'd':
                        debug = atoi(optarg);
                        break;
+               case 'I':
+                       init_d_path = optarg;
+                       break;
+               case 'R':
+                       rc_d_path = optarg;
+                       break;
                case 'S':
                        ulog_channels = ULOG_STDIO;
                        break;
diff --git a/procd.h b/procd.h
index f48edeb..55efc82 100644
--- a/procd.h
+++ b/procd.h
@@ -27,6 +27,9 @@
 
 #define __init __attribute__((constructor))
 
+extern const char *init_d_path;
+extern const char *rc_d_path;
+
 extern const char *ubus_socket;
 
 void procd_connect_ubus(void);
diff --git a/rcS.c b/rcS.c
index 45a96a9..1e36c98 100644
--- a/rcS.c
+++ b/rcS.c
@@ -33,6 +33,9 @@
 #include "procd.h"
 #include "rcS.h"
 
+const char *init_d_path = "/etc/init.d";
+const char *rc_d_path = "/etc/rc.d";
+
 static struct runqueue q, r;
 
 struct initd {
@@ -200,12 +203,12 @@ int rcS(const char *pattern, const char *param, void 
(*q_empty)(struct runqueue
        q.empty_cb = q_empty;
        q.max_running_tasks = 1;
 
-       return _rc(&q, "/etc/rc.d", pattern, "*", param);
+       return _rc(&q, rc_d_path, pattern, "*", param);
 }
 
 int rc(const char *file, const char *param)
 {
-       return _rc(&r, "/etc/init.d", file, "", param);
+       return _rc(&r, init_d_path, file, "", param);
 }
 
 static void r_empty(struct runqueue *q)
-- 
2.52.0



--- End Message ---
_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to