Commit Graph

26 Commits (4a6795409d1520fd3da3e909a8bcf9d7fd0927bb)

Author SHA1 Message Date
Jeffery To d13e86d4c2 procd: Add wrapper for uci_validate_section()
This adds a wrapper (uci_load_validate) for uci_validate_section() that
allows callers (through a callback function) to access the values set by
uci_validate_section(), without having to manually declare a
(potentially long) list of local variables.

The callback function receives two arguments when called, the config
section name and the return value of uci_validate_section().

If no callback function is given, then the wrapper exits with the value
returned by uci_validate_section().

This also updates several init scripts to use the new wrapper function.

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
5 years ago
Paul Spooren cbf69fb2ad cron: add procd listeners for crontabs
Add procd file listeners to check files in `/etc/crontabs/`.

Also unified a bit the function style.

Signed-off-by: Paul Spooren <mail@aparcar.org>
6 years ago
Piotr Dymacz 6e44f47a90 sysntpd: restore support for peer-less (standalone) mode
ntpd from Busybox supports peer-less (standalone) mode when it's started
with option -l and without any peer provided with option -p. In this
mode ntpd uses local time as reference and acts as stratum 1 server.

This mode can be used in isolated networks, where Internet access and/or
other NTP server/s are not available, but the device has some other way
of getting correct time, like e.g. GPS (ugps supports setting local time
by default).

Support for this mode was incorrectly disabled/removed in:
1527f96ca6

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
Acked-by: Jo-Philipp Wich <jo@mein.io>
7 years ago
Jan-Tarek Butt 02d5f9477b busybox: prevent globbing, word splitting
Double quote to prevent globbing and word splitting.

Signed-off-by: Jan-Tarek Butt <tarek@ring0.de>
8 years ago
Felix Fietkau 88304ea6e5 sysntpd: remove procd_open_trigger/procd_close_trigger calls
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Hans Dedecker 96db69bd45 busybox: Call ntpd hotplug script for every action
Daemons that are waiting for a timesync are only triggered when the action is stratum.
As step is the first sync action pass all actions to the ntpd hotplug scripts; it's up
to the ntpd hotplugscript to filter out the actions it is interested in.

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
8 years ago
Maxim Storchak 442ff3b34d busybox: run sysntpd at higher priority
When a router is under load ntpd would have better chance to accurately
maintain system time.

Signed-off-by: Maxim Storchak <m.storchak@gmail.com>
8 years ago
Hans Dedecker 6707d9750a busybox: sysntpd - Support for NTP servers received via DHCP(v6)
The busybox ntpd utility currently uses ntp servers specified in uci.
This patch allows the ntpd utility to use NTP servers received via DHCP(v6)
Following uci parameters have been added:
    use_dhcp : enables NTP server config via DHCP(v6)
    dhcp_interface : use NTP servers received only on the specified DHCP(v6) interfaces; if empty all interfaces are considered

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
8 years ago
Steven Barth d196b1fc2e Disable telnet in favor of passwordless SSH
This enables passworldless login for root via SSH whenever no root
password is set (e.g. after reset, flashing without keeping config
or in failsafe) and removes telnet support alltogether.

Signed-off-by: Steven Barth <steven@midlink.org>

SVN-Revision: 46809
9 years ago
Steven Barth 016d6acde5 ntp: add hotplug class for ntp-events
Based on a patch by Luiz Angelo Daros de Luca

Signed-off-by: Steven Barth <steven@midlink.org>

SVN-Revision: 43421
10 years ago
Steven Barth 3cdeac4173 busybox: remove validation message from bootup
A message:
uinteger - 9 = true
is displayed during boot. This is the result of the validate_data
command checking the cron log level. As the output is not
interesting, only the result, filter...

Signed-off-by: Michel Stam <m.stam@fugro.nl>

SVN-Revision: 42751
10 years ago
John Crispin 2ae05c57f8 package/*: remove useless explicit set of function returncode
somebody started to set a function returncode in the validation
stuff and everybody copies it, e.g.

myfunction()
{
	fire_command

	return $?
}

a function automatically returns with the last returncode,
so we can safely remove the command 'return $?'. reference:

http://tldp.org/LDP/abs/html/exit-status.html
"The last command executed in the function or script determines the exit status."

Signed-off-by: Bastian Bittorf <bittorf@bluebottle.com>

SVN-Revision: 42278
10 years ago
Luka Perkov 9dd205b2ad busybox: fix validation in sysntpd init script
Signed-off-by: Luka Perkov <luka@openwrt.org>

SVN-Revision: 41415
10 years ago
John Crispin a51588a5f9 busybox: use ntp enabled config option
Even if enabled option is missing from ntp configuration we are still keeping
default behavior.

Signed-off-by: Luka Perkov <luka@openwrt.org>

SVN-Revision: 41355
10 years ago
Felix Fietkau f960a1fdb0 busybox: fix processing of multiple NTP servers in the config (#15294)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 39935
10 years ago
Jo-Philipp Wich 1527f96ca6 busybox: do not abort sysntpd init if enable_server is unset, that variable just controls the server part for relaying NTP
SVN-Revision: 38936
11 years ago
John Crispin 93e9a71538 base-files: allow users to delect debug level during boot
Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 38909
11 years ago
John Crispin a9cfb4b827 procd: fixup 2 wrong option types
Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 38789
11 years ago
John Crispin 1f93857092 procd: convert services to the new validation api
Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 38787
11 years ago
Luka Perkov ef5f836207 fix various init scripts
Changes include:

* removing unused variables
* replacing spaces with tabs where appropriate
* more consistency with variable declarations

Signed-off-by: Luka Perkov <luka@openwrt.org>

SVN-Revision: 38142
11 years ago
John Crispin f874094402 procd: convert various packages to procd style init.d scripts
Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 38023
11 years ago
Jo-Philipp Wich c5b4d98d39 busybox: rename ntp init script back to sysntpd (#13920)
Renaming the init script to ntp broke LuCI time sync functionality and collides with other ntp packages

SVN-Revision: 37681
11 years ago
Luka Perkov 67f1d364b8 base-files/busybox: move ntpd init script from base-files to busybox
SVN-Revision: 37383
11 years ago
John Crispin 928b503435 busybox: convert crond init script to procd
Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 37243
11 years ago
John Crispin e3a6115686 busybox: convert telnet init script to procd
Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 37242
11 years ago
John Crispin 4ebf19b48f packages: clean up the package folder
Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 37007
11 years ago