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.

237 lines
9.1 KiB

mini_snmpd: 1.4-rc1 add git,autoconf,procd init script,uci validation - new upstream/openwrt maintainer Makes use of all available runtime options that can be passed to mini_snmpd such as -I listen_on interface Run-tested on trunk on ar71xx. Please review the init script regarding procd monitoring interfaces, though everything else due to the conversion to procd should be and done properly, if not overkill compared to most other script bundled with openwrt. The main benefit of all this is now larger routers can run multiple instances of mini_snmpd on different ports, to get around the MIB hard coded 4 interface/mountpoint limits. Due to somewhat lacking dev / package maintainer docs except for http://wiki.prplfoundation.org/wiki/Procd_reference writing this script took longer than it should. You can see it's evolution here: https://github.com/hojuruku/openwrt-packages/blob/mini_snmpd/net/mini_snmpd/files/mini_snmpd.init If everything in it is found to be sane, please include it to the openwrt wiki on procd as an example. Due to procd / uci /sbin/validate_data cbi element datatype (uciname) being used to check uci config, the configuration file now only takes openwrt uci network names not physical network names as it did before. http://git.openwrt.org/?p=packages.git;a=commit;h=783e5578ad104d1ca3c31582add08fc8eb4ad083 Like busybox the package Makefile has depends for all runtime dependencies needed by the init script. mini_snmpd only depends on libc squashed commits: mini_snmpd: fix typo to fix procd triggers calling daemon binary directly instead of init script - misuse of $PROG var mini_snmpd: enable SSP & mini_snmpd to start by default and listen on lan mini_snmpd: disable RELRO blocker in Makefile after consulation mini_snmpd: add smarts to init script to detect if ubusd hasn't started yet mini_snmpd: fix init script - ubus -S doesn't print meaningful errors to give the user mini_snmpd: Makefile roll back Makefile PKG_RELEASE to 1 for feng shui
8 years ago
mini_snmpd: 1.4-rc1 add git,autoconf,procd init script,uci validation - new upstream/openwrt maintainer Makes use of all available runtime options that can be passed to mini_snmpd such as -I listen_on interface Run-tested on trunk on ar71xx. Please review the init script regarding procd monitoring interfaces, though everything else due to the conversion to procd should be and done properly, if not overkill compared to most other script bundled with openwrt. The main benefit of all this is now larger routers can run multiple instances of mini_snmpd on different ports, to get around the MIB hard coded 4 interface/mountpoint limits. Due to somewhat lacking dev / package maintainer docs except for http://wiki.prplfoundation.org/wiki/Procd_reference writing this script took longer than it should. You can see it's evolution here: https://github.com/hojuruku/openwrt-packages/blob/mini_snmpd/net/mini_snmpd/files/mini_snmpd.init If everything in it is found to be sane, please include it to the openwrt wiki on procd as an example. Due to procd / uci /sbin/validate_data cbi element datatype (uciname) being used to check uci config, the configuration file now only takes openwrt uci network names not physical network names as it did before. http://git.openwrt.org/?p=packages.git;a=commit;h=783e5578ad104d1ca3c31582add08fc8eb4ad083 Like busybox the package Makefile has depends for all runtime dependencies needed by the init script. mini_snmpd only depends on libc squashed commits: mini_snmpd: fix typo to fix procd triggers calling daemon binary directly instead of init script - misuse of $PROG var mini_snmpd: enable SSP & mini_snmpd to start by default and listen on lan mini_snmpd: disable RELRO blocker in Makefile after consulation mini_snmpd: add smarts to init script to detect if ubusd hasn't started yet mini_snmpd: fix init script - ubus -S doesn't print meaningful errors to give the user mini_snmpd: Makefile roll back Makefile PKG_RELEASE to 1 for feng shui
8 years ago
mini_snmpd: 1.4-rc1 add git,autoconf,procd init script,uci validation - new upstream/openwrt maintainer Makes use of all available runtime options that can be passed to mini_snmpd such as -I listen_on interface Run-tested on trunk on ar71xx. Please review the init script regarding procd monitoring interfaces, though everything else due to the conversion to procd should be and done properly, if not overkill compared to most other script bundled with openwrt. The main benefit of all this is now larger routers can run multiple instances of mini_snmpd on different ports, to get around the MIB hard coded 4 interface/mountpoint limits. Due to somewhat lacking dev / package maintainer docs except for http://wiki.prplfoundation.org/wiki/Procd_reference writing this script took longer than it should. You can see it's evolution here: https://github.com/hojuruku/openwrt-packages/blob/mini_snmpd/net/mini_snmpd/files/mini_snmpd.init If everything in it is found to be sane, please include it to the openwrt wiki on procd as an example. Due to procd / uci /sbin/validate_data cbi element datatype (uciname) being used to check uci config, the configuration file now only takes openwrt uci network names not physical network names as it did before. http://git.openwrt.org/?p=packages.git;a=commit;h=783e5578ad104d1ca3c31582add08fc8eb4ad083 Like busybox the package Makefile has depends for all runtime dependencies needed by the init script. mini_snmpd only depends on libc squashed commits: mini_snmpd: fix typo to fix procd triggers calling daemon binary directly instead of init script - misuse of $PROG var mini_snmpd: enable SSP & mini_snmpd to start by default and listen on lan mini_snmpd: disable RELRO blocker in Makefile after consulation mini_snmpd: add smarts to init script to detect if ubusd hasn't started yet mini_snmpd: fix init script - ubus -S doesn't print meaningful errors to give the user mini_snmpd: Makefile roll back Makefile PKG_RELEASE to 1 for feng shui
8 years ago
mini_snmpd: 1.4-rc1 add git,autoconf,procd init script,uci validation - new upstream/openwrt maintainer Makes use of all available runtime options that can be passed to mini_snmpd such as -I listen_on interface Run-tested on trunk on ar71xx. Please review the init script regarding procd monitoring interfaces, though everything else due to the conversion to procd should be and done properly, if not overkill compared to most other script bundled with openwrt. The main benefit of all this is now larger routers can run multiple instances of mini_snmpd on different ports, to get around the MIB hard coded 4 interface/mountpoint limits. Due to somewhat lacking dev / package maintainer docs except for http://wiki.prplfoundation.org/wiki/Procd_reference writing this script took longer than it should. You can see it's evolution here: https://github.com/hojuruku/openwrt-packages/blob/mini_snmpd/net/mini_snmpd/files/mini_snmpd.init If everything in it is found to be sane, please include it to the openwrt wiki on procd as an example. Due to procd / uci /sbin/validate_data cbi element datatype (uciname) being used to check uci config, the configuration file now only takes openwrt uci network names not physical network names as it did before. http://git.openwrt.org/?p=packages.git;a=commit;h=783e5578ad104d1ca3c31582add08fc8eb4ad083 Like busybox the package Makefile has depends for all runtime dependencies needed by the init script. mini_snmpd only depends on libc squashed commits: mini_snmpd: fix typo to fix procd triggers calling daemon binary directly instead of init script - misuse of $PROG var mini_snmpd: enable SSP & mini_snmpd to start by default and listen on lan mini_snmpd: disable RELRO blocker in Makefile after consulation mini_snmpd: add smarts to init script to detect if ubusd hasn't started yet mini_snmpd: fix init script - ubus -S doesn't print meaningful errors to give the user mini_snmpd: Makefile roll back Makefile PKG_RELEASE to 1 for feng shui
8 years ago
mini_snmpd: 1.4-rc1 add git,autoconf,procd init script,uci validation - new upstream/openwrt maintainer Makes use of all available runtime options that can be passed to mini_snmpd such as -I listen_on interface Run-tested on trunk on ar71xx. Please review the init script regarding procd monitoring interfaces, though everything else due to the conversion to procd should be and done properly, if not overkill compared to most other script bundled with openwrt. The main benefit of all this is now larger routers can run multiple instances of mini_snmpd on different ports, to get around the MIB hard coded 4 interface/mountpoint limits. Due to somewhat lacking dev / package maintainer docs except for http://wiki.prplfoundation.org/wiki/Procd_reference writing this script took longer than it should. You can see it's evolution here: https://github.com/hojuruku/openwrt-packages/blob/mini_snmpd/net/mini_snmpd/files/mini_snmpd.init If everything in it is found to be sane, please include it to the openwrt wiki on procd as an example. Due to procd / uci /sbin/validate_data cbi element datatype (uciname) being used to check uci config, the configuration file now only takes openwrt uci network names not physical network names as it did before. http://git.openwrt.org/?p=packages.git;a=commit;h=783e5578ad104d1ca3c31582add08fc8eb4ad083 Like busybox the package Makefile has depends for all runtime dependencies needed by the init script. mini_snmpd only depends on libc squashed commits: mini_snmpd: fix typo to fix procd triggers calling daemon binary directly instead of init script - misuse of $PROG var mini_snmpd: enable SSP & mini_snmpd to start by default and listen on lan mini_snmpd: disable RELRO blocker in Makefile after consulation mini_snmpd: add smarts to init script to detect if ubusd hasn't started yet mini_snmpd: fix init script - ubus -S doesn't print meaningful errors to give the user mini_snmpd: Makefile roll back Makefile PKG_RELEASE to 1 for feng shui
8 years ago
mini_snmpd: 1.4-rc1 add git,autoconf,procd init script,uci validation - new upstream/openwrt maintainer Makes use of all available runtime options that can be passed to mini_snmpd such as -I listen_on interface Run-tested on trunk on ar71xx. Please review the init script regarding procd monitoring interfaces, though everything else due to the conversion to procd should be and done properly, if not overkill compared to most other script bundled with openwrt. The main benefit of all this is now larger routers can run multiple instances of mini_snmpd on different ports, to get around the MIB hard coded 4 interface/mountpoint limits. Due to somewhat lacking dev / package maintainer docs except for http://wiki.prplfoundation.org/wiki/Procd_reference writing this script took longer than it should. You can see it's evolution here: https://github.com/hojuruku/openwrt-packages/blob/mini_snmpd/net/mini_snmpd/files/mini_snmpd.init If everything in it is found to be sane, please include it to the openwrt wiki on procd as an example. Due to procd / uci /sbin/validate_data cbi element datatype (uciname) being used to check uci config, the configuration file now only takes openwrt uci network names not physical network names as it did before. http://git.openwrt.org/?p=packages.git;a=commit;h=783e5578ad104d1ca3c31582add08fc8eb4ad083 Like busybox the package Makefile has depends for all runtime dependencies needed by the init script. mini_snmpd only depends on libc squashed commits: mini_snmpd: fix typo to fix procd triggers calling daemon binary directly instead of init script - misuse of $PROG var mini_snmpd: enable SSP & mini_snmpd to start by default and listen on lan mini_snmpd: disable RELRO blocker in Makefile after consulation mini_snmpd: add smarts to init script to detect if ubusd hasn't started yet mini_snmpd: fix init script - ubus -S doesn't print meaningful errors to give the user mini_snmpd: Makefile roll back Makefile PKG_RELEASE to 1 for feng shui
8 years ago
mini_snmpd: 1.4-rc1 add git,autoconf,procd init script,uci validation - new upstream/openwrt maintainer Makes use of all available runtime options that can be passed to mini_snmpd such as -I listen_on interface Run-tested on trunk on ar71xx. Please review the init script regarding procd monitoring interfaces, though everything else due to the conversion to procd should be and done properly, if not overkill compared to most other script bundled with openwrt. The main benefit of all this is now larger routers can run multiple instances of mini_snmpd on different ports, to get around the MIB hard coded 4 interface/mountpoint limits. Due to somewhat lacking dev / package maintainer docs except for http://wiki.prplfoundation.org/wiki/Procd_reference writing this script took longer than it should. You can see it's evolution here: https://github.com/hojuruku/openwrt-packages/blob/mini_snmpd/net/mini_snmpd/files/mini_snmpd.init If everything in it is found to be sane, please include it to the openwrt wiki on procd as an example. Due to procd / uci /sbin/validate_data cbi element datatype (uciname) being used to check uci config, the configuration file now only takes openwrt uci network names not physical network names as it did before. http://git.openwrt.org/?p=packages.git;a=commit;h=783e5578ad104d1ca3c31582add08fc8eb4ad083 Like busybox the package Makefile has depends for all runtime dependencies needed by the init script. mini_snmpd only depends on libc squashed commits: mini_snmpd: fix typo to fix procd triggers calling daemon binary directly instead of init script - misuse of $PROG var mini_snmpd: enable SSP & mini_snmpd to start by default and listen on lan mini_snmpd: disable RELRO blocker in Makefile after consulation mini_snmpd: add smarts to init script to detect if ubusd hasn't started yet mini_snmpd: fix init script - ubus -S doesn't print meaningful errors to give the user mini_snmpd: Makefile roll back Makefile PKG_RELEASE to 1 for feng shui
8 years ago
mini_snmpd: 1.4-rc1 add git,autoconf,procd init script,uci validation - new upstream/openwrt maintainer Makes use of all available runtime options that can be passed to mini_snmpd such as -I listen_on interface Run-tested on trunk on ar71xx. Please review the init script regarding procd monitoring interfaces, though everything else due to the conversion to procd should be and done properly, if not overkill compared to most other script bundled with openwrt. The main benefit of all this is now larger routers can run multiple instances of mini_snmpd on different ports, to get around the MIB hard coded 4 interface/mountpoint limits. Due to somewhat lacking dev / package maintainer docs except for http://wiki.prplfoundation.org/wiki/Procd_reference writing this script took longer than it should. You can see it's evolution here: https://github.com/hojuruku/openwrt-packages/blob/mini_snmpd/net/mini_snmpd/files/mini_snmpd.init If everything in it is found to be sane, please include it to the openwrt wiki on procd as an example. Due to procd / uci /sbin/validate_data cbi element datatype (uciname) being used to check uci config, the configuration file now only takes openwrt uci network names not physical network names as it did before. http://git.openwrt.org/?p=packages.git;a=commit;h=783e5578ad104d1ca3c31582add08fc8eb4ad083 Like busybox the package Makefile has depends for all runtime dependencies needed by the init script. mini_snmpd only depends on libc squashed commits: mini_snmpd: fix typo to fix procd triggers calling daemon binary directly instead of init script - misuse of $PROG var mini_snmpd: enable SSP & mini_snmpd to start by default and listen on lan mini_snmpd: disable RELRO blocker in Makefile after consulation mini_snmpd: add smarts to init script to detect if ubusd hasn't started yet mini_snmpd: fix init script - ubus -S doesn't print meaningful errors to give the user mini_snmpd: Makefile roll back Makefile PKG_RELEASE to 1 for feng shui
8 years ago
mini_snmpd: 1.4-rc1 add git,autoconf,procd init script,uci validation - new upstream/openwrt maintainer Makes use of all available runtime options that can be passed to mini_snmpd such as -I listen_on interface Run-tested on trunk on ar71xx. Please review the init script regarding procd monitoring interfaces, though everything else due to the conversion to procd should be and done properly, if not overkill compared to most other script bundled with openwrt. The main benefit of all this is now larger routers can run multiple instances of mini_snmpd on different ports, to get around the MIB hard coded 4 interface/mountpoint limits. Due to somewhat lacking dev / package maintainer docs except for http://wiki.prplfoundation.org/wiki/Procd_reference writing this script took longer than it should. You can see it's evolution here: https://github.com/hojuruku/openwrt-packages/blob/mini_snmpd/net/mini_snmpd/files/mini_snmpd.init If everything in it is found to be sane, please include it to the openwrt wiki on procd as an example. Due to procd / uci /sbin/validate_data cbi element datatype (uciname) being used to check uci config, the configuration file now only takes openwrt uci network names not physical network names as it did before. http://git.openwrt.org/?p=packages.git;a=commit;h=783e5578ad104d1ca3c31582add08fc8eb4ad083 Like busybox the package Makefile has depends for all runtime dependencies needed by the init script. mini_snmpd only depends on libc squashed commits: mini_snmpd: fix typo to fix procd triggers calling daemon binary directly instead of init script - misuse of $PROG var mini_snmpd: enable SSP & mini_snmpd to start by default and listen on lan mini_snmpd: disable RELRO blocker in Makefile after consulation mini_snmpd: add smarts to init script to detect if ubusd hasn't started yet mini_snmpd: fix init script - ubus -S doesn't print meaningful errors to give the user mini_snmpd: Makefile roll back Makefile PKG_RELEASE to 1 for feng shui
8 years ago
mini_snmpd: 1.4-rc1 add git,autoconf,procd init script,uci validation - new upstream/openwrt maintainer Makes use of all available runtime options that can be passed to mini_snmpd such as -I listen_on interface Run-tested on trunk on ar71xx. Please review the init script regarding procd monitoring interfaces, though everything else due to the conversion to procd should be and done properly, if not overkill compared to most other script bundled with openwrt. The main benefit of all this is now larger routers can run multiple instances of mini_snmpd on different ports, to get around the MIB hard coded 4 interface/mountpoint limits. Due to somewhat lacking dev / package maintainer docs except for http://wiki.prplfoundation.org/wiki/Procd_reference writing this script took longer than it should. You can see it's evolution here: https://github.com/hojuruku/openwrt-packages/blob/mini_snmpd/net/mini_snmpd/files/mini_snmpd.init If everything in it is found to be sane, please include it to the openwrt wiki on procd as an example. Due to procd / uci /sbin/validate_data cbi element datatype (uciname) being used to check uci config, the configuration file now only takes openwrt uci network names not physical network names as it did before. http://git.openwrt.org/?p=packages.git;a=commit;h=783e5578ad104d1ca3c31582add08fc8eb4ad083 Like busybox the package Makefile has depends for all runtime dependencies needed by the init script. mini_snmpd only depends on libc squashed commits: mini_snmpd: fix typo to fix procd triggers calling daemon binary directly instead of init script - misuse of $PROG var mini_snmpd: enable SSP & mini_snmpd to start by default and listen on lan mini_snmpd: disable RELRO blocker in Makefile after consulation mini_snmpd: add smarts to init script to detect if ubusd hasn't started yet mini_snmpd: fix init script - ubus -S doesn't print meaningful errors to give the user mini_snmpd: Makefile roll back Makefile PKG_RELEASE to 1 for feng shui
8 years ago
mini_snmpd: 1.4-rc1 add git,autoconf,procd init script,uci validation - new upstream/openwrt maintainer Makes use of all available runtime options that can be passed to mini_snmpd such as -I listen_on interface Run-tested on trunk on ar71xx. Please review the init script regarding procd monitoring interfaces, though everything else due to the conversion to procd should be and done properly, if not overkill compared to most other script bundled with openwrt. The main benefit of all this is now larger routers can run multiple instances of mini_snmpd on different ports, to get around the MIB hard coded 4 interface/mountpoint limits. Due to somewhat lacking dev / package maintainer docs except for http://wiki.prplfoundation.org/wiki/Procd_reference writing this script took longer than it should. You can see it's evolution here: https://github.com/hojuruku/openwrt-packages/blob/mini_snmpd/net/mini_snmpd/files/mini_snmpd.init If everything in it is found to be sane, please include it to the openwrt wiki on procd as an example. Due to procd / uci /sbin/validate_data cbi element datatype (uciname) being used to check uci config, the configuration file now only takes openwrt uci network names not physical network names as it did before. http://git.openwrt.org/?p=packages.git;a=commit;h=783e5578ad104d1ca3c31582add08fc8eb4ad083 Like busybox the package Makefile has depends for all runtime dependencies needed by the init script. mini_snmpd only depends on libc squashed commits: mini_snmpd: fix typo to fix procd triggers calling daemon binary directly instead of init script - misuse of $PROG var mini_snmpd: enable SSP & mini_snmpd to start by default and listen on lan mini_snmpd: disable RELRO blocker in Makefile after consulation mini_snmpd: add smarts to init script to detect if ubusd hasn't started yet mini_snmpd: fix init script - ubus -S doesn't print meaningful errors to give the user mini_snmpd: Makefile roll back Makefile PKG_RELEASE to 1 for feng shui
8 years ago
mini_snmpd: 1.4-rc1 add git,autoconf,procd init script,uci validation - new upstream/openwrt maintainer Makes use of all available runtime options that can be passed to mini_snmpd such as -I listen_on interface Run-tested on trunk on ar71xx. Please review the init script regarding procd monitoring interfaces, though everything else due to the conversion to procd should be and done properly, if not overkill compared to most other script bundled with openwrt. The main benefit of all this is now larger routers can run multiple instances of mini_snmpd on different ports, to get around the MIB hard coded 4 interface/mountpoint limits. Due to somewhat lacking dev / package maintainer docs except for http://wiki.prplfoundation.org/wiki/Procd_reference writing this script took longer than it should. You can see it's evolution here: https://github.com/hojuruku/openwrt-packages/blob/mini_snmpd/net/mini_snmpd/files/mini_snmpd.init If everything in it is found to be sane, please include it to the openwrt wiki on procd as an example. Due to procd / uci /sbin/validate_data cbi element datatype (uciname) being used to check uci config, the configuration file now only takes openwrt uci network names not physical network names as it did before. http://git.openwrt.org/?p=packages.git;a=commit;h=783e5578ad104d1ca3c31582add08fc8eb4ad083 Like busybox the package Makefile has depends for all runtime dependencies needed by the init script. mini_snmpd only depends on libc squashed commits: mini_snmpd: fix typo to fix procd triggers calling daemon binary directly instead of init script - misuse of $PROG var mini_snmpd: enable SSP & mini_snmpd to start by default and listen on lan mini_snmpd: disable RELRO blocker in Makefile after consulation mini_snmpd: add smarts to init script to detect if ubusd hasn't started yet mini_snmpd: fix init script - ubus -S doesn't print meaningful errors to give the user mini_snmpd: Makefile roll back Makefile PKG_RELEASE to 1 for feng shui
8 years ago
mini_snmpd: 1.4-rc1 add git,autoconf,procd init script,uci validation - new upstream/openwrt maintainer Makes use of all available runtime options that can be passed to mini_snmpd such as -I listen_on interface Run-tested on trunk on ar71xx. Please review the init script regarding procd monitoring interfaces, though everything else due to the conversion to procd should be and done properly, if not overkill compared to most other script bundled with openwrt. The main benefit of all this is now larger routers can run multiple instances of mini_snmpd on different ports, to get around the MIB hard coded 4 interface/mountpoint limits. Due to somewhat lacking dev / package maintainer docs except for http://wiki.prplfoundation.org/wiki/Procd_reference writing this script took longer than it should. You can see it's evolution here: https://github.com/hojuruku/openwrt-packages/blob/mini_snmpd/net/mini_snmpd/files/mini_snmpd.init If everything in it is found to be sane, please include it to the openwrt wiki on procd as an example. Due to procd / uci /sbin/validate_data cbi element datatype (uciname) being used to check uci config, the configuration file now only takes openwrt uci network names not physical network names as it did before. http://git.openwrt.org/?p=packages.git;a=commit;h=783e5578ad104d1ca3c31582add08fc8eb4ad083 Like busybox the package Makefile has depends for all runtime dependencies needed by the init script. mini_snmpd only depends on libc squashed commits: mini_snmpd: fix typo to fix procd triggers calling daemon binary directly instead of init script - misuse of $PROG var mini_snmpd: enable SSP & mini_snmpd to start by default and listen on lan mini_snmpd: disable RELRO blocker in Makefile after consulation mini_snmpd: add smarts to init script to detect if ubusd hasn't started yet mini_snmpd: fix init script - ubus -S doesn't print meaningful errors to give the user mini_snmpd: Makefile roll back Makefile PKG_RELEASE to 1 for feng shui
8 years ago
mini_snmpd: 1.4-rc1 add git,autoconf,procd init script,uci validation - new upstream/openwrt maintainer Makes use of all available runtime options that can be passed to mini_snmpd such as -I listen_on interface Run-tested on trunk on ar71xx. Please review the init script regarding procd monitoring interfaces, though everything else due to the conversion to procd should be and done properly, if not overkill compared to most other script bundled with openwrt. The main benefit of all this is now larger routers can run multiple instances of mini_snmpd on different ports, to get around the MIB hard coded 4 interface/mountpoint limits. Due to somewhat lacking dev / package maintainer docs except for http://wiki.prplfoundation.org/wiki/Procd_reference writing this script took longer than it should. You can see it's evolution here: https://github.com/hojuruku/openwrt-packages/blob/mini_snmpd/net/mini_snmpd/files/mini_snmpd.init If everything in it is found to be sane, please include it to the openwrt wiki on procd as an example. Due to procd / uci /sbin/validate_data cbi element datatype (uciname) being used to check uci config, the configuration file now only takes openwrt uci network names not physical network names as it did before. http://git.openwrt.org/?p=packages.git;a=commit;h=783e5578ad104d1ca3c31582add08fc8eb4ad083 Like busybox the package Makefile has depends for all runtime dependencies needed by the init script. mini_snmpd only depends on libc squashed commits: mini_snmpd: fix typo to fix procd triggers calling daemon binary directly instead of init script - misuse of $PROG var mini_snmpd: enable SSP & mini_snmpd to start by default and listen on lan mini_snmpd: disable RELRO blocker in Makefile after consulation mini_snmpd: add smarts to init script to detect if ubusd hasn't started yet mini_snmpd: fix init script - ubus -S doesn't print meaningful errors to give the user mini_snmpd: Makefile roll back Makefile PKG_RELEASE to 1 for feng shui
8 years ago
mini_snmpd: 1.4-rc1 add git,autoconf,procd init script,uci validation - new upstream/openwrt maintainer Makes use of all available runtime options that can be passed to mini_snmpd such as -I listen_on interface Run-tested on trunk on ar71xx. Please review the init script regarding procd monitoring interfaces, though everything else due to the conversion to procd should be and done properly, if not overkill compared to most other script bundled with openwrt. The main benefit of all this is now larger routers can run multiple instances of mini_snmpd on different ports, to get around the MIB hard coded 4 interface/mountpoint limits. Due to somewhat lacking dev / package maintainer docs except for http://wiki.prplfoundation.org/wiki/Procd_reference writing this script took longer than it should. You can see it's evolution here: https://github.com/hojuruku/openwrt-packages/blob/mini_snmpd/net/mini_snmpd/files/mini_snmpd.init If everything in it is found to be sane, please include it to the openwrt wiki on procd as an example. Due to procd / uci /sbin/validate_data cbi element datatype (uciname) being used to check uci config, the configuration file now only takes openwrt uci network names not physical network names as it did before. http://git.openwrt.org/?p=packages.git;a=commit;h=783e5578ad104d1ca3c31582add08fc8eb4ad083 Like busybox the package Makefile has depends for all runtime dependencies needed by the init script. mini_snmpd only depends on libc squashed commits: mini_snmpd: fix typo to fix procd triggers calling daemon binary directly instead of init script - misuse of $PROG var mini_snmpd: enable SSP & mini_snmpd to start by default and listen on lan mini_snmpd: disable RELRO blocker in Makefile after consulation mini_snmpd: add smarts to init script to detect if ubusd hasn't started yet mini_snmpd: fix init script - ubus -S doesn't print meaningful errors to give the user mini_snmpd: Makefile roll back Makefile PKG_RELEASE to 1 for feng shui
8 years ago
mini_snmpd: 1.4-rc1 add git,autoconf,procd init script,uci validation - new upstream/openwrt maintainer Makes use of all available runtime options that can be passed to mini_snmpd such as -I listen_on interface Run-tested on trunk on ar71xx. Please review the init script regarding procd monitoring interfaces, though everything else due to the conversion to procd should be and done properly, if not overkill compared to most other script bundled with openwrt. The main benefit of all this is now larger routers can run multiple instances of mini_snmpd on different ports, to get around the MIB hard coded 4 interface/mountpoint limits. Due to somewhat lacking dev / package maintainer docs except for http://wiki.prplfoundation.org/wiki/Procd_reference writing this script took longer than it should. You can see it's evolution here: https://github.com/hojuruku/openwrt-packages/blob/mini_snmpd/net/mini_snmpd/files/mini_snmpd.init If everything in it is found to be sane, please include it to the openwrt wiki on procd as an example. Due to procd / uci /sbin/validate_data cbi element datatype (uciname) being used to check uci config, the configuration file now only takes openwrt uci network names not physical network names as it did before. http://git.openwrt.org/?p=packages.git;a=commit;h=783e5578ad104d1ca3c31582add08fc8eb4ad083 Like busybox the package Makefile has depends for all runtime dependencies needed by the init script. mini_snmpd only depends on libc squashed commits: mini_snmpd: fix typo to fix procd triggers calling daemon binary directly instead of init script - misuse of $PROG var mini_snmpd: enable SSP & mini_snmpd to start by default and listen on lan mini_snmpd: disable RELRO blocker in Makefile after consulation mini_snmpd: add smarts to init script to detect if ubusd hasn't started yet mini_snmpd: fix init script - ubus -S doesn't print meaningful errors to give the user mini_snmpd: Makefile roll back Makefile PKG_RELEASE to 1 for feng shui
8 years ago
mini_snmpd: 1.4-rc1 add git,autoconf,procd init script,uci validation - new upstream/openwrt maintainer Makes use of all available runtime options that can be passed to mini_snmpd such as -I listen_on interface Run-tested on trunk on ar71xx. Please review the init script regarding procd monitoring interfaces, though everything else due to the conversion to procd should be and done properly, if not overkill compared to most other script bundled with openwrt. The main benefit of all this is now larger routers can run multiple instances of mini_snmpd on different ports, to get around the MIB hard coded 4 interface/mountpoint limits. Due to somewhat lacking dev / package maintainer docs except for http://wiki.prplfoundation.org/wiki/Procd_reference writing this script took longer than it should. You can see it's evolution here: https://github.com/hojuruku/openwrt-packages/blob/mini_snmpd/net/mini_snmpd/files/mini_snmpd.init If everything in it is found to be sane, please include it to the openwrt wiki on procd as an example. Due to procd / uci /sbin/validate_data cbi element datatype (uciname) being used to check uci config, the configuration file now only takes openwrt uci network names not physical network names as it did before. http://git.openwrt.org/?p=packages.git;a=commit;h=783e5578ad104d1ca3c31582add08fc8eb4ad083 Like busybox the package Makefile has depends for all runtime dependencies needed by the init script. mini_snmpd only depends on libc squashed commits: mini_snmpd: fix typo to fix procd triggers calling daemon binary directly instead of init script - misuse of $PROG var mini_snmpd: enable SSP & mini_snmpd to start by default and listen on lan mini_snmpd: disable RELRO blocker in Makefile after consulation mini_snmpd: add smarts to init script to detect if ubusd hasn't started yet mini_snmpd: fix init script - ubus -S doesn't print meaningful errors to give the user mini_snmpd: Makefile roll back Makefile PKG_RELEASE to 1 for feng shui
8 years ago
mini_snmpd: 1.4-rc1 add git,autoconf,procd init script,uci validation - new upstream/openwrt maintainer Makes use of all available runtime options that can be passed to mini_snmpd such as -I listen_on interface Run-tested on trunk on ar71xx. Please review the init script regarding procd monitoring interfaces, though everything else due to the conversion to procd should be and done properly, if not overkill compared to most other script bundled with openwrt. The main benefit of all this is now larger routers can run multiple instances of mini_snmpd on different ports, to get around the MIB hard coded 4 interface/mountpoint limits. Due to somewhat lacking dev / package maintainer docs except for http://wiki.prplfoundation.org/wiki/Procd_reference writing this script took longer than it should. You can see it's evolution here: https://github.com/hojuruku/openwrt-packages/blob/mini_snmpd/net/mini_snmpd/files/mini_snmpd.init If everything in it is found to be sane, please include it to the openwrt wiki on procd as an example. Due to procd / uci /sbin/validate_data cbi element datatype (uciname) being used to check uci config, the configuration file now only takes openwrt uci network names not physical network names as it did before. http://git.openwrt.org/?p=packages.git;a=commit;h=783e5578ad104d1ca3c31582add08fc8eb4ad083 Like busybox the package Makefile has depends for all runtime dependencies needed by the init script. mini_snmpd only depends on libc squashed commits: mini_snmpd: fix typo to fix procd triggers calling daemon binary directly instead of init script - misuse of $PROG var mini_snmpd: enable SSP & mini_snmpd to start by default and listen on lan mini_snmpd: disable RELRO blocker in Makefile after consulation mini_snmpd: add smarts to init script to detect if ubusd hasn't started yet mini_snmpd: fix init script - ubus -S doesn't print meaningful errors to give the user mini_snmpd: Makefile roll back Makefile PKG_RELEASE to 1 for feng shui
8 years ago
mini_snmpd: 1.4-rc1 add git,autoconf,procd init script,uci validation - new upstream/openwrt maintainer Makes use of all available runtime options that can be passed to mini_snmpd such as -I listen_on interface Run-tested on trunk on ar71xx. Please review the init script regarding procd monitoring interfaces, though everything else due to the conversion to procd should be and done properly, if not overkill compared to most other script bundled with openwrt. The main benefit of all this is now larger routers can run multiple instances of mini_snmpd on different ports, to get around the MIB hard coded 4 interface/mountpoint limits. Due to somewhat lacking dev / package maintainer docs except for http://wiki.prplfoundation.org/wiki/Procd_reference writing this script took longer than it should. You can see it's evolution here: https://github.com/hojuruku/openwrt-packages/blob/mini_snmpd/net/mini_snmpd/files/mini_snmpd.init If everything in it is found to be sane, please include it to the openwrt wiki on procd as an example. Due to procd / uci /sbin/validate_data cbi element datatype (uciname) being used to check uci config, the configuration file now only takes openwrt uci network names not physical network names as it did before. http://git.openwrt.org/?p=packages.git;a=commit;h=783e5578ad104d1ca3c31582add08fc8eb4ad083 Like busybox the package Makefile has depends for all runtime dependencies needed by the init script. mini_snmpd only depends on libc squashed commits: mini_snmpd: fix typo to fix procd triggers calling daemon binary directly instead of init script - misuse of $PROG var mini_snmpd: enable SSP & mini_snmpd to start by default and listen on lan mini_snmpd: disable RELRO blocker in Makefile after consulation mini_snmpd: add smarts to init script to detect if ubusd hasn't started yet mini_snmpd: fix init script - ubus -S doesn't print meaningful errors to give the user mini_snmpd: Makefile roll back Makefile PKG_RELEASE to 1 for feng shui
8 years ago
mini_snmpd: 1.4-rc1 add git,autoconf,procd init script,uci validation - new upstream/openwrt maintainer Makes use of all available runtime options that can be passed to mini_snmpd such as -I listen_on interface Run-tested on trunk on ar71xx. Please review the init script regarding procd monitoring interfaces, though everything else due to the conversion to procd should be and done properly, if not overkill compared to most other script bundled with openwrt. The main benefit of all this is now larger routers can run multiple instances of mini_snmpd on different ports, to get around the MIB hard coded 4 interface/mountpoint limits. Due to somewhat lacking dev / package maintainer docs except for http://wiki.prplfoundation.org/wiki/Procd_reference writing this script took longer than it should. You can see it's evolution here: https://github.com/hojuruku/openwrt-packages/blob/mini_snmpd/net/mini_snmpd/files/mini_snmpd.init If everything in it is found to be sane, please include it to the openwrt wiki on procd as an example. Due to procd / uci /sbin/validate_data cbi element datatype (uciname) being used to check uci config, the configuration file now only takes openwrt uci network names not physical network names as it did before. http://git.openwrt.org/?p=packages.git;a=commit;h=783e5578ad104d1ca3c31582add08fc8eb4ad083 Like busybox the package Makefile has depends for all runtime dependencies needed by the init script. mini_snmpd only depends on libc squashed commits: mini_snmpd: fix typo to fix procd triggers calling daemon binary directly instead of init script - misuse of $PROG var mini_snmpd: enable SSP & mini_snmpd to start by default and listen on lan mini_snmpd: disable RELRO blocker in Makefile after consulation mini_snmpd: add smarts to init script to detect if ubusd hasn't started yet mini_snmpd: fix init script - ubus -S doesn't print meaningful errors to give the user mini_snmpd: Makefile roll back Makefile PKG_RELEASE to 1 for feng shui
8 years ago
mini_snmpd: 1.4-rc1 add git,autoconf,procd init script,uci validation - new upstream/openwrt maintainer Makes use of all available runtime options that can be passed to mini_snmpd such as -I listen_on interface Run-tested on trunk on ar71xx. Please review the init script regarding procd monitoring interfaces, though everything else due to the conversion to procd should be and done properly, if not overkill compared to most other script bundled with openwrt. The main benefit of all this is now larger routers can run multiple instances of mini_snmpd on different ports, to get around the MIB hard coded 4 interface/mountpoint limits. Due to somewhat lacking dev / package maintainer docs except for http://wiki.prplfoundation.org/wiki/Procd_reference writing this script took longer than it should. You can see it's evolution here: https://github.com/hojuruku/openwrt-packages/blob/mini_snmpd/net/mini_snmpd/files/mini_snmpd.init If everything in it is found to be sane, please include it to the openwrt wiki on procd as an example. Due to procd / uci /sbin/validate_data cbi element datatype (uciname) being used to check uci config, the configuration file now only takes openwrt uci network names not physical network names as it did before. http://git.openwrt.org/?p=packages.git;a=commit;h=783e5578ad104d1ca3c31582add08fc8eb4ad083 Like busybox the package Makefile has depends for all runtime dependencies needed by the init script. mini_snmpd only depends on libc squashed commits: mini_snmpd: fix typo to fix procd triggers calling daemon binary directly instead of init script - misuse of $PROG var mini_snmpd: enable SSP & mini_snmpd to start by default and listen on lan mini_snmpd: disable RELRO blocker in Makefile after consulation mini_snmpd: add smarts to init script to detect if ubusd hasn't started yet mini_snmpd: fix init script - ubus -S doesn't print meaningful errors to give the user mini_snmpd: Makefile roll back Makefile PKG_RELEASE to 1 for feng shui
8 years ago
mini_snmpd: 1.4-rc1 add git,autoconf,procd init script,uci validation - new upstream/openwrt maintainer Makes use of all available runtime options that can be passed to mini_snmpd such as -I listen_on interface Run-tested on trunk on ar71xx. Please review the init script regarding procd monitoring interfaces, though everything else due to the conversion to procd should be and done properly, if not overkill compared to most other script bundled with openwrt. The main benefit of all this is now larger routers can run multiple instances of mini_snmpd on different ports, to get around the MIB hard coded 4 interface/mountpoint limits. Due to somewhat lacking dev / package maintainer docs except for http://wiki.prplfoundation.org/wiki/Procd_reference writing this script took longer than it should. You can see it's evolution here: https://github.com/hojuruku/openwrt-packages/blob/mini_snmpd/net/mini_snmpd/files/mini_snmpd.init If everything in it is found to be sane, please include it to the openwrt wiki on procd as an example. Due to procd / uci /sbin/validate_data cbi element datatype (uciname) being used to check uci config, the configuration file now only takes openwrt uci network names not physical network names as it did before. http://git.openwrt.org/?p=packages.git;a=commit;h=783e5578ad104d1ca3c31582add08fc8eb4ad083 Like busybox the package Makefile has depends for all runtime dependencies needed by the init script. mini_snmpd only depends on libc squashed commits: mini_snmpd: fix typo to fix procd triggers calling daemon binary directly instead of init script - misuse of $PROG var mini_snmpd: enable SSP & mini_snmpd to start by default and listen on lan mini_snmpd: disable RELRO blocker in Makefile after consulation mini_snmpd: add smarts to init script to detect if ubusd hasn't started yet mini_snmpd: fix init script - ubus -S doesn't print meaningful errors to give the user mini_snmpd: Makefile roll back Makefile PKG_RELEASE to 1 for feng shui
8 years ago
mini_snmpd: 1.4-rc1 add git,autoconf,procd init script,uci validation - new upstream/openwrt maintainer Makes use of all available runtime options that can be passed to mini_snmpd such as -I listen_on interface Run-tested on trunk on ar71xx. Please review the init script regarding procd monitoring interfaces, though everything else due to the conversion to procd should be and done properly, if not overkill compared to most other script bundled with openwrt. The main benefit of all this is now larger routers can run multiple instances of mini_snmpd on different ports, to get around the MIB hard coded 4 interface/mountpoint limits. Due to somewhat lacking dev / package maintainer docs except for http://wiki.prplfoundation.org/wiki/Procd_reference writing this script took longer than it should. You can see it's evolution here: https://github.com/hojuruku/openwrt-packages/blob/mini_snmpd/net/mini_snmpd/files/mini_snmpd.init If everything in it is found to be sane, please include it to the openwrt wiki on procd as an example. Due to procd / uci /sbin/validate_data cbi element datatype (uciname) being used to check uci config, the configuration file now only takes openwrt uci network names not physical network names as it did before. http://git.openwrt.org/?p=packages.git;a=commit;h=783e5578ad104d1ca3c31582add08fc8eb4ad083 Like busybox the package Makefile has depends for all runtime dependencies needed by the init script. mini_snmpd only depends on libc squashed commits: mini_snmpd: fix typo to fix procd triggers calling daemon binary directly instead of init script - misuse of $PROG var mini_snmpd: enable SSP & mini_snmpd to start by default and listen on lan mini_snmpd: disable RELRO blocker in Makefile after consulation mini_snmpd: add smarts to init script to detect if ubusd hasn't started yet mini_snmpd: fix init script - ubus -S doesn't print meaningful errors to give the user mini_snmpd: Makefile roll back Makefile PKG_RELEASE to 1 for feng shui
8 years ago
mini_snmpd: 1.4-rc1 add git,autoconf,procd init script,uci validation - new upstream/openwrt maintainer Makes use of all available runtime options that can be passed to mini_snmpd such as -I listen_on interface Run-tested on trunk on ar71xx. Please review the init script regarding procd monitoring interfaces, though everything else due to the conversion to procd should be and done properly, if not overkill compared to most other script bundled with openwrt. The main benefit of all this is now larger routers can run multiple instances of mini_snmpd on different ports, to get around the MIB hard coded 4 interface/mountpoint limits. Due to somewhat lacking dev / package maintainer docs except for http://wiki.prplfoundation.org/wiki/Procd_reference writing this script took longer than it should. You can see it's evolution here: https://github.com/hojuruku/openwrt-packages/blob/mini_snmpd/net/mini_snmpd/files/mini_snmpd.init If everything in it is found to be sane, please include it to the openwrt wiki on procd as an example. Due to procd / uci /sbin/validate_data cbi element datatype (uciname) being used to check uci config, the configuration file now only takes openwrt uci network names not physical network names as it did before. http://git.openwrt.org/?p=packages.git;a=commit;h=783e5578ad104d1ca3c31582add08fc8eb4ad083 Like busybox the package Makefile has depends for all runtime dependencies needed by the init script. mini_snmpd only depends on libc squashed commits: mini_snmpd: fix typo to fix procd triggers calling daemon binary directly instead of init script - misuse of $PROG var mini_snmpd: enable SSP & mini_snmpd to start by default and listen on lan mini_snmpd: disable RELRO blocker in Makefile after consulation mini_snmpd: add smarts to init script to detect if ubusd hasn't started yet mini_snmpd: fix init script - ubus -S doesn't print meaningful errors to give the user mini_snmpd: Makefile roll back Makefile PKG_RELEASE to 1 for feng shui
8 years ago
mini_snmpd: 1.4-rc1 add git,autoconf,procd init script,uci validation - new upstream/openwrt maintainer Makes use of all available runtime options that can be passed to mini_snmpd such as -I listen_on interface Run-tested on trunk on ar71xx. Please review the init script regarding procd monitoring interfaces, though everything else due to the conversion to procd should be and done properly, if not overkill compared to most other script bundled with openwrt. The main benefit of all this is now larger routers can run multiple instances of mini_snmpd on different ports, to get around the MIB hard coded 4 interface/mountpoint limits. Due to somewhat lacking dev / package maintainer docs except for http://wiki.prplfoundation.org/wiki/Procd_reference writing this script took longer than it should. You can see it's evolution here: https://github.com/hojuruku/openwrt-packages/blob/mini_snmpd/net/mini_snmpd/files/mini_snmpd.init If everything in it is found to be sane, please include it to the openwrt wiki on procd as an example. Due to procd / uci /sbin/validate_data cbi element datatype (uciname) being used to check uci config, the configuration file now only takes openwrt uci network names not physical network names as it did before. http://git.openwrt.org/?p=packages.git;a=commit;h=783e5578ad104d1ca3c31582add08fc8eb4ad083 Like busybox the package Makefile has depends for all runtime dependencies needed by the init script. mini_snmpd only depends on libc squashed commits: mini_snmpd: fix typo to fix procd triggers calling daemon binary directly instead of init script - misuse of $PROG var mini_snmpd: enable SSP & mini_snmpd to start by default and listen on lan mini_snmpd: disable RELRO blocker in Makefile after consulation mini_snmpd: add smarts to init script to detect if ubusd hasn't started yet mini_snmpd: fix init script - ubus -S doesn't print meaningful errors to give the user mini_snmpd: Makefile roll back Makefile PKG_RELEASE to 1 for feng shui
8 years ago
mini_snmpd: 1.4-rc1 add git,autoconf,procd init script,uci validation - new upstream/openwrt maintainer Makes use of all available runtime options that can be passed to mini_snmpd such as -I listen_on interface Run-tested on trunk on ar71xx. Please review the init script regarding procd monitoring interfaces, though everything else due to the conversion to procd should be and done properly, if not overkill compared to most other script bundled with openwrt. The main benefit of all this is now larger routers can run multiple instances of mini_snmpd on different ports, to get around the MIB hard coded 4 interface/mountpoint limits. Due to somewhat lacking dev / package maintainer docs except for http://wiki.prplfoundation.org/wiki/Procd_reference writing this script took longer than it should. You can see it's evolution here: https://github.com/hojuruku/openwrt-packages/blob/mini_snmpd/net/mini_snmpd/files/mini_snmpd.init If everything in it is found to be sane, please include it to the openwrt wiki on procd as an example. Due to procd / uci /sbin/validate_data cbi element datatype (uciname) being used to check uci config, the configuration file now only takes openwrt uci network names not physical network names as it did before. http://git.openwrt.org/?p=packages.git;a=commit;h=783e5578ad104d1ca3c31582add08fc8eb4ad083 Like busybox the package Makefile has depends for all runtime dependencies needed by the init script. mini_snmpd only depends on libc squashed commits: mini_snmpd: fix typo to fix procd triggers calling daemon binary directly instead of init script - misuse of $PROG var mini_snmpd: enable SSP & mini_snmpd to start by default and listen on lan mini_snmpd: disable RELRO blocker in Makefile after consulation mini_snmpd: add smarts to init script to detect if ubusd hasn't started yet mini_snmpd: fix init script - ubus -S doesn't print meaningful errors to give the user mini_snmpd: Makefile roll back Makefile PKG_RELEASE to 1 for feng shui
8 years ago
  1. #!/bin/sh /etc/rc.common
  2. # Copyright (C) 2009-2016 OpenWrt.org
  3. # Copyright (C) 2016 Luke McKee <hojuruku@gmail.com>
  4. # Procd init script reference: http://wiki.prplfoundation.org/wiki/Procd_reference
  5. START=98
  6. USE_PROCD=1
  7. PROG=/usr/bin/mini_snmpd
  8. NAME=mini_snmpd
  9. _log() {
  10. logger -p daemon.info -t mini_snmpd "$@"
  11. }
  12. _err() {
  13. logger -p daemon.err -t mini_snmpd "$@"
  14. }
  15. # mini_snmpd 1.3+ now starts later in the game. Expects filesystems monitored to be already mounted, or wont pass args to mini_snmpd
  16. # and at least configuration entry for network physical interface defined in /etc/config/network
  17. # It handles network interfaces not yet present (e.g. ppp) but will statfs() the root/wrong filesystem if device not mounted
  18. # Tip: complex scripts run faster without in openwrt if you stop busybox forking and searching for applets. Faster bootups
  19. # CONFIG_BUSYBOX_CONFIG_FEATURE_SH_NOFORK
  20. # CONFIG_BUSYBOX_CONFIG_FEATURE_PREFER_APPLETS
  21. # BUSYBOX_CONFIG_ASH_OPTIMIZE_FOR_SIZE [=n]
  22. # CONFIG_BUSYBOX_CONFIG_ASH_CMDCMD
  23. mini_snmpd_validation="enabled:bool:0 \
  24. ipv6:bool:0 \
  25. debug:bool:0 \
  26. auth:bool:1 \
  27. community:rangelength(1,32):public \
  28. contact:maxlength(255) \
  29. location:maxlength(255) \
  30. listen_interface:uciname \
  31. udp_port:port \
  32. tcp_port:port \
  33. vendor_oid:string \
  34. mib_timeout:and(min(1),uinteger) \
  35. disks:list(directory) \
  36. interfaces:list(uciname) \
  37. respawn_threshold:uinteger respawn_timeout:uinteger respawn_retry:uinteger"
  38. # busybox ash has no array variable support, when put validations in a string be careful to have no spaces in each validate constraint
  39. # this makes it very difficult to use the 'or(uciname, "all")' test, so listen_interface '' or undefined now meands bind to "all".
  40. # this is the sarafice you have to make to avoid typing it all in twice in this script so we can give feedback to user on what's misconfigered
  41. # in syslog
  42. append_disk() {
  43. local disk="$1" disk_count
  44. [ -z $disk_count ] && disk_count=0
  45. if grep -qF "$disk" /proc/mounts ; then
  46. # check the fileystem is mountpoint, and directory search permissions available for statfs()
  47. # presence as a directory -d test done is already done by uci_validate_section()
  48. [ -x "$disk" ] || {
  49. _err "$cfg: mountpoint $disk for snmp monitoring EACCES error. Check permissions, ignoring"
  50. return 1
  51. }
  52. if [ $disk_count -lt 4 ] ; then
  53. append disks_arg "$disk" ','
  54. disk_count=$((disk_count++))
  55. else
  56. _err "$cfg: more than 4 mountpoints defined in uci. Disc $disk ignored."
  57. fi
  58. else
  59. _err "$cfg: mountpoint $disk for snmp monitoring not mounted, ignoring."
  60. fi
  61. }
  62. append_interface() {
  63. local name="$1" netdev netdev_count
  64. [ -z $netdev_count ] && netdev_count=0
  65. # for the purposes of snmp monitoring it doesn't need to be up, it just needs to exist in /proc/net/dev
  66. network_get_device netdev "$name"
  67. if [ -n "$netdev" ] && grep -qF "$netdev" /proc/net/dev ]; then
  68. [ $netdev_count -ge 4 ] && {
  69. _err "$cfg: too many network interfaces configured, ignoring $name"
  70. return
  71. }
  72. netdev_count=$((netdev_count++))
  73. if [ -n "$interfaces_arg" ]; then
  74. append interfaces_arg "$netdev" ','
  75. else
  76. append interfaces_arg "$netdev"
  77. fi
  78. else
  79. _log "$cfg: physical interface for network $name not found in uci or kernel so not monitoring"
  80. fi
  81. }
  82. append_arg() {
  83. local var="$2"
  84. local opt="$1"
  85. [ -n "$var" ] && procd_append_param command $opt "$var"
  86. }
  87. watch_interfaces() {
  88. local cfg="$1"
  89. local enabled listen_interface # listen_interface_up
  90. config_get_bool enabled "$cfg" "enabled" '1'
  91. [ "$enabled" -gt 0 ] || return 0
  92. config_get listen_interface "$cfg" listen_interface
  93. # If the interface is up & instance is running we'll watch at the instance level and only restart that instance if it's bound interface changes
  94. # Regardless of ubus knowing about an interface (in the case it's not yet configured)
  95. [ -n "$listen_interface" ] && trigger_interfaces="${listen_interface} ${trigger_interfaces} "
  96. # Restart daemon if one of monitored interfaces changes
  97. config_get reload_interfaces "$cfg" interfaces
  98. }
  99. validate_mini_snmpd_section() {
  100. # validate a mini_snmpd instance in uci config file mini_snmpd
  101. # http://luci.subsignal.org/trac/wiki/Documentation/Datatypes ubox/validate/validate.c
  102. uci_validate_section mini_snmpd mini_snmpd "${1}" $mini_snmpd_validation
  103. }
  104. service_triggers() {
  105. config_load 'mini_snmpd'
  106. procd_open_trigger
  107. procd_add_config_trigger "config.change" "mini_snmpd" /etc/init.d/mini_snmpd reload
  108. config_foreach watch_interfaces 'mini_snmpd'
  109. # this only watches interfaces for which there is no running instance due to interface down / not in ubus
  110. # hence start not reload, this trigger will not affect running instances as another start will not change their procd command arguments
  111. # or stop the already running process
  112. [ -n "$trigger_interfaces" ] & {
  113. for n in $trigger_interfaces ; do
  114. procd_add_interface_trigger "interface.*" $n /etc/init.d/mini_snmpd start
  115. done
  116. }
  117. [ -n "$reload_interfaces" ] && {
  118. for n in $reload_interfaces; do
  119. procd_add_reload_interface_trigger $n
  120. done
  121. }
  122. procd_close_trigger
  123. procd_add_validation validate_mini_snmpd_section
  124. }
  125. start_instance() {
  126. local cfg validation_failed validation_err disks_arg interfaces_arg
  127. cfg="$1"
  128. #uci_validate_section should unset undefined variables from other instances
  129. #however defining uci variables as local will scope them to this instance
  130. #"local variables are also visible to functions called by the parent function" so it's good practice
  131. local enabled ipv6 debug auth community contact location listen_interface \
  132. udp_port tcp_port vendor_oid mib_timeout
  133. local disks="" interfaces=""
  134. validate_mini_snmpd_section "$cfg" 2>/dev/null || validation_failed=1
  135. [ "$enabled" == 1 ] || {
  136. _log "instance:$cfg disabled not starting"
  137. return 1
  138. }
  139. local listen_interface_json listen_interface_ip listen_interface_device listen_interface_up
  140. [ -n "$listen_interface" ] && {
  141. if [ "$ipv6" = 1 ]; then
  142. network_get_ipaddrs6 listen_interface_ip "$listen_interface"
  143. else
  144. network_get_ipaddrs listen_interface_ip "$listen_interface"
  145. fi
  146. network_is_up "$listen_interface" && [ -n "$listen_interface_ip" ] || {
  147. _log "$cfg:listen interface $listen_interface not up yet / not configured properly"
  148. _log "$cfg:procd will try again when interface state changes"
  149. return 1
  150. }
  151. network_get_physdev listen_interface_device "$listen_interface"
  152. }
  153. [ $validation_failed ] && {
  154. _err "validation of $NAME configuration for $cfg instance failed, all tests should be within constraints"
  155. _err "please edit the configuration values below using [l]uci "
  156. validation_err=`/sbin/validate_data mini_snmpd mini_snmpd "$cfg" $mini_snmpd_validation 2>&1 | sed '/with\ false$/!d;s/validates\ as\ /needs\ to\ be\ /;s/with\ false//' `
  157. _err "${validation_err}"
  158. return 1
  159. }
  160. config_list_foreach "$cfg" 'disks' append_disk
  161. config_list_foreach "$cfg" 'interfaces' append_interface
  162. # test if variables are unset or zero length
  163. [ -z "${disks_arg:+1}" -a -z "${interfaces_arg:+1}" ] && {
  164. _err "$cfg: you haven't sucessfully configured any mountpoints or disks for this instance, not starting"
  165. return 1
  166. }
  167. procd_open_instance
  168. procd_set_param command "$PROG" -n
  169. procd_set_param stdout "1"
  170. procd_set_param stderr "1"
  171. # don't the like default respawn values? you can override through uci.
  172. # vars left as global so you only need to do it in the first mini_snmpd instance
  173. procd_set_param respawn ${respawn_threshold:-3600} ${respawn_timeout:-10} ${respawn_retry:-1}
  174. # this monitors ubus changes
  175. [ -n "$listen_interface" ] && {
  176. #procd_open_trigger
  177. #procd_add_interface_trigger "interface.*" $listen_interface /etc/init.d/mini_snmpd reload
  178. #procd_close_trigger
  179. procd_add_reload_interface_trigger $listen_interface #or use shorthand of above
  180. }
  181. # this re-starts the daemon if a properly configured network interface is changed whilst it is already running
  182. # igmpproxy has this as well as "procd_set_param netdev"
  183. append_arg "-c" "$community"
  184. append_arg "-L" "${location}"
  185. append_arg "-C" "${contact}"
  186. append_arg "-p" $udp_port
  187. append_arg "-P" $tcp_port
  188. append_arg "-V" "${vendor_oid}"
  189. append_arg "-t" $mib_timeout
  190. [ "$ipv6" = 1 ] && procd_append_param command "-6"
  191. [ "$debug" = 1 ] && procd_append_param command "-v"
  192. # uci_validate_section() aka /sbin/validate_data can only cast default values not defined in /etc/config/* to string
  193. # e.g. ="1" however it sets bools defined in /etc/config/* to =1 / =0
  194. [ "$auth" = 1 -o "$auth" = "1" ] && procd_append_param command "-a"
  195. [ -n "$disks_arg" ] && procd_append_param command "-d" "$disks_arg"
  196. [ -n "$interfaces_arg" ] && {
  197. procd_append_param netdev ${interfaces_arg//,/ }
  198. procd_append_param command "-i" "$interfaces_arg"
  199. }
  200. [ -n "$listen_interface_device" ] && {
  201. procd_append_param command "-I" "$listen_interface_device"
  202. # and this monitors the hardware device for changes outside of ubus - just a guess
  203. procd_append_param netdev $listen_interface_device
  204. }
  205. procd_close_instance
  206. }
  207. start_service() {
  208. . /lib/functions.sh
  209. . /lib/functions/network.sh
  210. config_load 'mini_snmpd'
  211. config_foreach start_instance 'mini_snmpd'
  212. }