[batmand] main: Allow one to disable forking to background in debug_mode 0 (2f62b17)
by postmaster@open-mesh.org
Repository : ssh://git@diktynna/batmand
On branch : main
>---------------------------------------------------------------
commit 2f62b17d4132f82c4716b672101eb7faa916192a
Author: Sven Eckelmann <sven(a)narfation.org>
Date: Sun Dec 1 14:39:00 2013 +0100
Allow one to disable forking to background in debug_mode 0
>---------------------------------------------------------------
2f62b17d4132f82c4716b672101eb7faa916192a
batman.c | 1 +
man/batmand.8 | 3 +++
posix/init.c | 13 +++++++++----
3 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/batman.c b/batman.c
index c3dfa7f..1c21fa8 100644
--- a/batman.c
+++ b/batman.c
@@ -145,6 +145,7 @@ void usage(void)
fprintf( stderr, " -v print version\n" );
fprintf( stderr, " --policy-routing-script\n" );
fprintf( stderr, " --disable-client-nat\n" );
+ fprintf( stderr, " --no-detach\n" );
}
diff --git a/man/batmand.8 b/man/batmand.8
index 89fcde5..38956ef 100644
--- a/man/batmand.8
+++ b/man/batmand.8
@@ -123,6 +123,9 @@ Since no topology database is computed by the protocol an additional solution to
.B \-\-disable\-client\-nat
Since version 0.3.2 batmand uses iptables to set the NAT rules on the gateX interface of the batman client (\-r XX). That option disables this feature of batmand and switches the internet tunnel mode to "half tunnels" (the packets towards the gateway are tunneled but not the packets that are coming back) unless NAT was enabled manually. Be sure to know what you are doing! Without NAT the gateway needs to have a route to the client or the packets will be dropped silently.
.TP
+.B \-\-no\-detach
+Run batmand in foreground
+.TP
.B \-\-policy\-routing\-script
This option disables the policy routing feature of batmand \(hy all routing changes are send to the script which can make use of this information or not. Firmware and package maintainers can use this option to tightly integrate batmand into their own routing policies. This option is only available in daemon mode.
.SH EXAMPLES
diff --git a/posix/init.c b/posix/init.c
index cb710f2..4533cdc 100644
--- a/posix/init.c
+++ b/posix/init.c
@@ -51,6 +51,7 @@
#include "../types.h"
int8_t stop;
+int no_detach;
static void create_routing_pipe(void)
@@ -124,6 +125,7 @@ void apply_init_args( int argc, char *argv[] ) {
{"purge-timeout", required_argument, 0, 'q'},
{"disable-aggregation", no_argument, 0, 'x'},
{"disable-client-nat", no_argument, 0, 'z'},
+ {"no-detach", no_argument, 0, 'D'},
{0, 0, 0, 0}
};
@@ -131,7 +133,7 @@ void apply_init_args( int argc, char *argv[] ) {
stop = 0;
prog_name = argv[0];
- while ( ( optchar = getopt_long( argc, argv, "a:A:bcd:hHio:g:p:r:s:vV", long_options, &option_index ) ) != -1 ) {
+ while ( ( optchar = getopt_long( argc, argv, "a:A:bcd:hHio:g:p:r:s:vVD", long_options, &option_index ) ) != -1 ) {
switch ( optchar ) {
@@ -343,6 +345,11 @@ void apply_init_args( int argc, char *argv[] ) {
found_args++;
break;
+ case 'D':
+ no_detach = 1;
+ found_args++;
+ break;
+
case 'h':
default:
usage();
@@ -501,12 +508,10 @@ void apply_init_args( int argc, char *argv[] ) {
/* daemonize */
if (debug_level == 0) {
- if (daemon(0, 0) < 0) {
-
+ if (!no_detach && daemon(0, 0) < 0) {
printf("Error - can't fork to background: %s\n", strerror(errno));
restore_defaults();
exit(EXIT_FAILURE);
-
}
openlog("batmand", LOG_PID, LOG_DAEMON);
1 month
[batmand] branch 'main' created
by postmaster@open-mesh.org
Repository : ssh://git@diktynna/batmand
New branch : main
Referencing: 9a2237ba89597d3203e737daf0fcb916d08417ff
1 month
[batmand] main: Allow one to disable forking to background in debug_mode 0 (9a2237b)
by postmaster@open-mesh.org
Repository : ssh://git@diktynna/batmand
On branch : main
>---------------------------------------------------------------
commit 9a2237ba89597d3203e737daf0fcb916d08417ff
Author: Sven Eckelmann <sven(a)narfation.org>
Date: Sun Dec 1 14:39:00 2013 +0100
Allow one to disable forking to background in debug_mode 0
>---------------------------------------------------------------
9a2237ba89597d3203e737daf0fcb916d08417ff
posix/init.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/posix/init.c b/posix/init.c
index cb710f2..4533cdc 100644
--- a/posix/init.c
+++ b/posix/init.c
@@ -51,6 +51,7 @@
#include "../types.h"
int8_t stop;
+int no_detach;
static void create_routing_pipe(void)
@@ -124,6 +125,7 @@ void apply_init_args( int argc, char *argv[] ) {
{"purge-timeout", required_argument, 0, 'q'},
{"disable-aggregation", no_argument, 0, 'x'},
{"disable-client-nat", no_argument, 0, 'z'},
+ {"no-detach", no_argument, 0, 'D'},
{0, 0, 0, 0}
};
@@ -131,7 +133,7 @@ void apply_init_args( int argc, char *argv[] ) {
stop = 0;
prog_name = argv[0];
- while ( ( optchar = getopt_long( argc, argv, "a:A:bcd:hHio:g:p:r:s:vV", long_options, &option_index ) ) != -1 ) {
+ while ( ( optchar = getopt_long( argc, argv, "a:A:bcd:hHio:g:p:r:s:vVD", long_options, &option_index ) ) != -1 ) {
switch ( optchar ) {
@@ -343,6 +345,11 @@ void apply_init_args( int argc, char *argv[] ) {
found_args++;
break;
+ case 'D':
+ no_detach = 1;
+ found_args++;
+ break;
+
case 'h':
default:
usage();
@@ -501,12 +508,10 @@ void apply_init_args( int argc, char *argv[] ) {
/* daemonize */
if (debug_level == 0) {
- if (daemon(0, 0) < 0) {
-
+ if (!no_detach && daemon(0, 0) < 0) {
printf("Error - can't fork to background: %s\n", strerror(errno));
restore_defaults();
exit(EXIT_FAILURE);
-
}
openlog("batmand", LOG_PID, LOG_DAEMON);
1 month
[linux-merge]linux integration; annotated tag, v6.1.1, created. v6.1.1
by postmaster@open-mesh.org
The annotated tag, v6.1.1 has been created
at 328192d2bf67781d5485a10aca3c256dc707828a (tag)
tagging ebdb69c5b054f115ef5ff72f0bb2aaa1718904e6 (commit)
replaces v6.1
tagged by Greg Kroah-Hartman
on Wed Dec 21 17:48:20 2022 +0100
- Shortlog ------------------------------------------------------------
This is the 6.1.1 stable release
-----BEGIN PGP SIGNATURE-----
iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAmOjONUACgkQONu9yGCS
aT5F1A/9E4PZt92roZ7SPLJXue+eQCQGyU/+0zIDVz88a0ss/CDM3c4nSWu2pQzA
YdhIPhaRGHMShIX/6hSyR5rG4Y0K8l1axowMQB3iaAo6Wgj+rjEJ5PhJXL7CdegC
V+iFgQX9bT+oBO1YDD17DNBxJBFIKvwoLvOHkJjMsYNc3eFAlxS1OFRWcOX3kkN6
AmDcPXGfSQjOvWpZKn2yfj7Sz1yE2HAl/UD3vH+L52mcbFVs7Su7E7kDKXUpkyya
JJ3ppVPQpgQPfY0JwpzVmNwxAHqOc4JGmA6REOudtuQ5jI8RWGo/VzT5BfN3Bz4T
pte5nCYYv0Psft3TfScAxz/f6n92+8JD6Gazusrk0yicVzoOsqWZmJs69LwvqW6S
OLIFdxJG4wXjj2E1rruU96+peImn3IhFOOEQ1lGwaY5G8IRnjyfpg9NQ8bDvouNP
JEHyCmI/0iAzFBiK2tW7H/+j9I4zx5PZpbb9jbujUjjh76Fm/4VMAHXSbcCyTcu8
Uc+Ir77uV9V4Eg4GPu//4Lq15oQBk6sYEhG1IKiBmYCbTSCZ5YJuox01OWGuG2aF
T/ivdFJsJ/y289TeRmd40/OqM2730OQTLZutRe7yMtqiRSISYDniYQbdalBRtD/P
/bvpHlQWhGz74EtiqazPzPfzyop/njzotaIQNLiCYZDnC1NEYSE=
=uunz
-----END PGP SIGNATURE-----
-----------------------------------------------------------------------
--
linux integration
1 month, 1 week
[linux-merge]linux integration; annotated tag, v5.4.228, created. v5.4.228
by postmaster@open-mesh.org
The annotated tag, v5.4.228 has been created
at c56c3a9d4cd9a901d30fe149f8e8f6d39e7c07f7 (tag)
tagging 851c2b5fb7936d54e1147f76f88e2675f9f82b52 (commit)
replaces v5.4.227
tagged by Greg Kroah-Hartman
on Mon Dec 19 12:25:14 2022 +0100
- Shortlog ------------------------------------------------------------
This is the 5.4.228 stable release
-----BEGIN PGP SIGNATURE-----
iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAmOgShoACgkQONu9yGCS
aT6y8hAArfx14MjKT2KO2ofFZbFhgSL7t9EKwbhUgL6uu+0zHqjyPOf4iSWiRDCx
cR9bEV15klGIHeu9PWlk6+EGz7lGRStJXlctTGvPTTsvP01LOmqFISSktuB0p9QO
oaJGAgMIVWj8O1Q6W6zRrxAIB+Dc4kVwaiiyNccc4V+4GYGOVR36f4sr6x9DSspy
cFke4iwDnCENxVa/HzbQBVZ7l1DagW20xbm6grHLqPcyK3NKcpQqRSLKtFQHjjpx
pv7+XHYq7CpARSM+pmO6PcyCVI8+/VZj99nqRobhOTZmEawUvW6RFX19+IOVFSTX
4ZCvk49g+AHQJRY1+AwnYCPZYle3qCjDjrAldBf+Hf906SyVS4t9IG7i6i2AMjcT
k/A6GLFVswAN+oV5hN7InZYFLdznzWJfIyCZXzFGaFx5p3mTCO6F9s/JYRlgR40Q
YXeUZGlH13gJoQXN3EWrxwQnXGuXUJnHpbCWgiUFq8lKwVvOs1NvjjLbdPzFrwmW
YGIG1lgKOcA26JqqvKC0+WnfW6dlsNQY39J/4eY6r7RfFcbNJQK03ZCCuUpNHIGw
A/X8uArb7W+sm9N2o/gW7dulP0Ih2ll/aq2eXdfnEAq78n7DxEieQSgKOkgqfrhS
9M+zyRF6EcQkF5CzSmjyaPpVmNaND/LaHnIrb5LvPOel0eCenGo=
=UWla
-----END PGP SIGNATURE-----
-----------------------------------------------------------------------
--
linux integration
1 month, 1 week
[linux-merge]linux integration; annotated tag, v5.10.161, created. v5.10.161
by postmaster@open-mesh.org
The annotated tag, v5.10.161 has been created
at 7b932a1b1ce872447d3bcd7716493b6c1661a90d (tag)
tagging 1a9148dfd8e03835dc7617cee696dd18c0000e99 (commit)
replaces v5.10.159
tagged by Greg Kroah-Hartman
on Wed Dec 21 17:32:12 2022 +0100
- Shortlog ------------------------------------------------------------
This is the 5.10.161 stable release
-----BEGIN PGP SIGNATURE-----
iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAmOjNQwACgkQONu9yGCS
aT77vA/+ObviSj6xTnLmHY8o409jNc1IUMJzUOLRaHs2j3ZZGE4WCjZTUajx/TMA
1rBSxy5/iEs2JnOKmJHSzxlLePuWDOxoiPq8JeWCelxjicz0aojq6cZkJF9dRgQV
l2NMEMH3ywKvJSoLMz4xU+m5u63QHNLSm3purim9wsCFvN5zN0ygyB60qUzOmQL4
So+/gLq483XhEXUewwKCwROClER43Cgi5bJ3uE5QBypEtiACczb6JTLTg9kvIhih
c1I5GLXUeHuluY90T///K/EBlERrrpM2KojHlOM0kQ2BCLMxPVLq9F/vBDJ9wWkF
i7hvYrlQEvJTbo52QUw/DjYTb/X7Hzn5i70lt8fxv3fHmXokOot2kXhnfVr5v++e
8xVoNhkRRkoq0MPVtls9GVFvXlyDal7Rb+7OUd2PNDDCTCp0WWk+VCgboxiz6LL3
EORAQPZZjaFpeZ8obYEVC72zRz8JfMxP37tWoGh0ifva7KrkXP37zAzPHBdivPnj
p+VDFDCgdqgpktn5yFNj7RbaCvCzM2NQuMlC7wWspecwd335Z5rRScKUNphPisy+
8MOVqDbaxU5Ivo7O4OLlRVOqeJ7y2sijFelBCo/BBc/B1pCRc1P5nxSQL4u2kuto
/5PIZ7jZ/n8STDAjDAufvKht3oH94iR1CWIGn1Lbqm73lj8GSqo=
=Qq8Q
-----END PGP SIGNATURE-----
-----------------------------------------------------------------------
--
linux integration
1 month, 1 week
[linux-merge]linux integration; annotated tag, v5.15.85, created. v5.15.85
by postmaster@open-mesh.org
The annotated tag, v5.15.85 has been created
at 35cedc48ec293425276f44f290df4e4616295595 (tag)
tagging 5827ddaf4534c52d31dd464679a186b41810ef76 (commit)
replaces v5.15.83
tagged by Greg Kroah-Hartman
on Wed Dec 21 17:36:41 2022 +0100
- Shortlog ------------------------------------------------------------
This is the 5.15.85 stable release
-----BEGIN PGP SIGNATURE-----
iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAmOjNhoACgkQONu9yGCS
aT5DXhAAtPM2I+HAdy2OLp4uD8uNc7o85xcyy3lykdl9O5BA2HzigspEpfqstSup
9b0M+tgqWCq5McAcLMcgTp/LyqDYOJN//n87WBUf+MicSoLfAXffgdr0ataHUMPV
yzbf5YYzDFPdjptWu0QCuMIOQvY2GBnjgFk1r/di3t2LyqYMZIGlDLSHTPXL/S8f
ZqiDuvUugor9zauxJ0XNwGKrLnv8h8vxSTNwOwhCy7Ryv5wTRiv2jUTChYOgmStj
S7lQlG35bTJLhKxB5qa+JNalgVzsRq6pwUOl5feFSktCFDPGlQ0ebf8R6MSCcp7S
a6OW7wOhWDUGaYJaU8BHsf3QE4LjSTE8j/3VPDgtZsOLb9VT4YYhRnVgjKORI/1q
/s9uNHR03+zS3v8aVnNhae0BI7oqKnlsjtS+cK9Y+rC/XG+1IckKuPjGQcTfa2E0
XiwoFNfiIjoyHG6mKN6z4vvyCHtCI0AXtPz3FQysAmyJ7SV/9BBep5XGzhmn7/B8
a0aaG4cCORIRduxYzsWwnaQT1kE0HH4UVwGK5M95HpL67wzaX5UkxivL5C9psgS0
x6v3go91b7THevv3N8waPZrJ4tv/GSvTaKsd+BMwkEOwlUha5R0esAM33Xjdz7dp
jRE1KGESFmuXEoRDlH1YkW12qFZAvX6tqYJLuZZ0Zs8S5kwcXFw=
=I3jQ
-----END PGP SIGNATURE-----
-----------------------------------------------------------------------
--
linux integration
1 month, 1 week
[linux-merge]linux integration; annotated tag, v6.0.15, created. v6.0.15
by postmaster@open-mesh.org
The annotated tag, v6.0.15 has been created
at 731f8c357d25a9fe5a5b9992bb7c0dd6d1c7862f (tag)
tagging 0106d88e2d2781a962e99c11d1ab336b0d7e893f (commit)
replaces v6.0.13
tagged by Greg Kroah-Hartman
on Wed Dec 21 17:41:19 2022 +0100
- Shortlog ------------------------------------------------------------
This is the 6.0.15 stable release
-----BEGIN PGP SIGNATURE-----
iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAmOjNy8ACgkQONu9yGCS
aT6aFxAAwMhavKq2kZ+KeOfn1KpG9l9JeDD0muUoFDIpitf0QbHELa90aCSi4AMV
ivnVhGHiv7St63w8l0mVuB2m2aAUjlvAYIGvj8Js17xzB2sGVpztU9vMACSk0Dcd
utDUWTXTa9UqqCNeKY9JHJurBJpi3RzkDessRk/3CQ6bViIvgiW9W8oi3l2fwmAo
QgGdjob1aLnY9SeSSr27p+v/XEdd/qHdzI1S4n4g2AbH43IjSgCyN1ly+BNtpfda
/7xvUegHfN8jncxjsJ8ZFXa5F/GXTiHoh3HJmPTpVvWOeJs6qCRpmYp76yaSpZVu
crxCjWLK2FaymvneLH3KLWMa/1VuYQJPutYuCu2Q/v9L9vB2K6ihGjZQNM4Fx+W1
uM8X95uCS5slLczstBeLWsWOeX95PfcAZkZx4CdUu4lYtpoR3hi5xPIKhO9rzkmL
/XY3+bp5Oi4SyV7d0zTRsGRCV2nhes/t1tqJfp8Pn+8H9f6YL81v+XElz+3MM8ti
JeDCSKPhwG+IVIHNUQz1wSBlODf1VIWIw4pGNysE+IDy4aiIEXXmUuLW1Aq1siVb
NlsRGtyN0d6C2LQG1xwJjPDEJktohal9/OwWNkCNmBP/kHiZamD94ElmyfdfPCon
yQpxfHjY+tlPXga8/FwPmHZdugzxc5sPHfUhc1InSLFbOFoZZXU=
=f9x3
-----END PGP SIGNATURE-----
-----------------------------------------------------------------------
--
linux integration
1 month, 1 week