aboutsummaryrefslogtreecommitdiff
path: root/examples
Commit message (Collapse)AuthorAgeFilesLines
* examples: remove /sbin/ prefixes, system should be configured with $PATH to ↵Gravatar Denys Vlasenko2020-12-134-10/+10
| | | | | | find utilities Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* examples/udhcp/simple.script: fix IPv6 support when using udhcpcGravatar Stefan Agner2020-06-211-1/+1
| | | | | | | | | | | | | | | | | | The udhcpc script calls ip addr flush .. which flushes addresses of any address family, including IPv6. However, busybox udhcpc is IPv4 only and should not influence IPv6 addressing. Hence use ip addr flush with family constraint. The script particularly broke IPv6 SLAAC: Typically when udhcpc calls the script the kernel already assigned the IPv6 link-local address. The flush removes the link-local IPv6 address again and prohibits proper IPv6 operation such as SLAAC since neighbor discovery protocol relies on IPv6 link-local addressing. Signed-off-by: Stefan Agner <stefan.agner@toradex.com> [Taken from https://git.openembedded.org/openembedded-core/commit/meta/recipes-core/busybox/files/simple.script?id=b77541dbb2f442e51842f9d24c8745a6df2d1478] Signed-off-by: Quentin Schulz <quentin.schulz@streamunlimited.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Updated inittab example documentationGravatar Denys Vlasenko2019-11-171-17/+30
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* examples/udhcp/simple.script: print the filename actually changedGravatar Rolf Eike Beer2019-09-121-1/+1
| | | | | Signed-off-by: Rolf Eike Beer <eb@emlix.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* examples/udhcp/simple.script: up interface on deconfig eventGravatar Denys Vlasenko2019-09-051-1/+2
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* typo fix in commentGravatar Denys Vlasenko2019-05-161-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* udhcpd: support per-client hostnames in static leasesGravatar Denys Vlasenko2019-05-161-2/+7
| | | | | | | | | | function old new delta read_staticlease 222 299 +77 add_server_options 92 154 +62 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/0 up/down: 139/0) Total: 139 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* examples/var_service: use "exec sleep 5" instead of "{ sleep 5; exit; }"Gravatar Denys Vlasenko2019-04-215-5/+5
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* examples/udhcp/simple.script: fix resolv.conf update if it is a dangling symlinkGravatar Rolf Eike Beer2019-04-131-0/+4
| | | | | | | | | | If /etc/resolv.conf is a symlink to a tmpfs and the actual file does not already exist, "readlink -f" will not detect it as symlink. Explicitely check for that condition before and touch the file, making the other code work as intended. Signed-off-by: Rolf Eike Beer <eb@emlix.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* service examples: if iface do not exist, retry upping itGravatar Denys Vlasenko2019-04-055-8/+8
| | | | | | | | | | I've had a case of a machine where eth0 was appearing a bit later after the boot, and appearing _downed_. ifplugd then fails to detect "link up". Thus, depending on how service startup ("ip link set dev eth0 up") races with driver initialization, ethernet randomly fails to initialize on boot. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* dhcp service example: rewrite "private network to mask" as case statementGravatar Denys Vlasenko2019-02-081-8/+13
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* dhcp service example: cater for servers hot giving subnet and/or routerGravatar Denys Vlasenko2019-02-051-0/+19
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* service examples: do not respawn supplicant too oftenGravatar Denys Vlasenko2019-02-021-1/+2
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* service examples: ifplugd -M to prevents frequent respawningGravatar Denys Vlasenko2019-01-181-1/+2
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Update examples/udhcp/udhcpd.confGravatar Denys Vlasenko2019-01-151-36/+42
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* examples/udhcp/simple.script: add possibility to use modern "ip"Gravatar Jiří Prchal2018-10-301-3/+15
| | | | | | | | Script uses "ifconfig" only, not up-to-date so much. This patch adds "ip" in condition if exists. Signed-off-by: Jiří Prchal <jiri.prchal@aksignal.cz> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* examples/var_service: add /var/run flag file to ntp.scriptGravatar Denys Vlasenko2018-07-261-1/+3
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* examples/var_service/: use standard logger script, viewer and pager scriptsGravatar Denys Vlasenko2018-07-0351-383/+81
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* examples/var_service/: use "svc" for service commands, other tweaksGravatar Denys Vlasenko2018-07-038-30/+35
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* examples: update /var/service/getty for Unicode ttysGravatar Denys Vlasenko2018-06-235-194/+206
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* tweak /var/service exampleGravatar Denys Vlasenko2018-05-201-9/+14
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* examples/shutdown-1.0: an example of reboot which does not signal initGravatar Denys Vlasenko2018-04-207-0/+475
| | | | | | For one, my inits know nothing about the concept of "shutting down the system". Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* setlogcons: open /dev/ttyN for "setlogcons N", not /dev/tty1Gravatar Denys Vlasenko2018-04-161-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* udhcp: support string user options, closes 10946Gravatar Denys Vlasenko2018-04-131-1/+2
| | | | | | | | | | | function old new delta udhcp_str2optset 536 628 +92 packed_usage 32757 32760 +3 udhcpc_main 2708 2692 -16 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/1 up/down: 95/-16) Total: 79 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* examples/var_service: new example: dnsmasq serviceGravatar Denys Vlasenko2018-03-307-0/+165
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* svok: new applet (daemontools compat)Gravatar Denys Vlasenko2018-03-302-2/+9
| | | | | | | | | | | | | | function old new delta svok_main - 127 +127 packed_usage 32705 32757 +52 applet_names 2756 2761 +5 applet_main 1588 1592 +4 bb_banner 46 47 +1 sv 1286 1284 -2 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 4/1 up/down: 189/-2) Total: 187 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ifplugd service example: always run up/down script on startupGravatar Denys Vlasenko2018-03-301-8/+9
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* udhcpd: fix "not dying on SIGTERM"Gravatar Denys Vlasenko2018-03-102-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes: commit 52a515d18724bbb34e3ccbbb0218efcc4eccc0a8 "udhcp: use poll() instead of select()" Feb 16 2017 udhcp_sp_read() is meant to check whether signal pipe indeed has some data to read. In the above commit, it was changed as follows: - if (!FD_ISSET(signal_pipe.rd, rfds)) + if (!pfds[0].revents) return 0; The problem is, the check was working for select() purely by accident. Caught signal interrupts select()/poll() syscalls, they return with EINTR (regardless of SA_RESTART flag in sigaction). _Then_ signal handler is invoked. IOW: they can't see any changes to fd state caused by signal haldler (in our case, signal handler makes signal pipe ready to be read). For select(), it means that rfds[] bit array is unmodified, bit of signal pipe's read fd is still set, and the above check "works": it thinks select() says there is data to read. This accident does not work for poll(): .revents stays clear, and we do not try reading signal pipe as we should. In udhcpd, we fall through and block in socket read. Further SIGTERM signals simply cause socket read to be interrupted and then restarted (since SIGTERM handler has SA_RESTART=1). Fixing this as follows: remove the check altogether. Set signal pipe read fd to nonblocking mode. Always read it in udhcp_sp_read(). If read fails, assume it's EAGAIN and return 0 ("no signal seen"). udhcpd avoids reading signal pipe on every recvd packet by looping if EINTR (using safe_poll()) - thus ensuring we have correct .revents for all fds - and calling udhcp_sp_read() only if pfds[0].revents!=0. udhcpc performs much fewer reads (typically it sleeps >99.999% of the time), there is no need to optimize it: can call udhcp_sp_read() after each poll unconditionally. To robustify socket reads, unconditionally set pfds[1].revents=0 in udhcp_sp_fd_set() (which is before poll), and check it before reading network socket in udhcpd. TODO: This might still fail: if pfds[1].revents=POLLIN, socket read may still block. There are rare cases when select/poll indicates that data can be read, but then actual read still blocks (one such case is UDP packets with wrong checksum). General advise is, if you use a poll/select loop, keep all your fds nonblocking. Maybe we should also do that to our network sockets? function old new delta udhcp_sp_setup 55 65 +10 udhcp_sp_fd_set 54 60 +6 udhcp_sp_read 46 36 -10 udhcpd_main 1451 1437 -14 udhcpc_main 2723 2708 -15 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/3 up/down: 16/-39) Total: -23 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* tweak examples/var_service/*Gravatar Denys Vlasenko2017-07-272-7/+9
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* fix more instances of ": $((a++))" in shell scriptsGravatar Denys Vlasenko2017-07-152-2/+2
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Spelling fixes in comments, documentation, tests and examplesGravatar Denys Vlasenko2017-04-171-1/+1
| | | | | | By klemens <ka7@github.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* examples: make udhcpc script handle /32 netmasksGravatar Denys Vlasenko2017-04-063-5/+25
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* remove "local" bashism from a few scriptsGravatar Denys Vlasenko2017-01-241-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* README_distro_proposal.txt: typo fixesGravatar Tito Ragusa2017-01-031-7/+7
| | | | | Signed-off-by: Tito Ragusa <farmatito@tiscali.it> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Update to examples/var_service/README_distro_proposal.txtGravatar Denys Vlasenko2016-12-251-14/+21
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* mdev.conf: rename hw_random to hwrngGravatar Mike Frysinger2016-12-091-0/+2
| | | | | | | | | | The kernel broke the name years ago, but didn't notice until it was much too late. Rename the node to match expectations of userland software, and what the kernel itself documents in its Kconfig help: This provides a device that's usually called /dev/hwrng, ... URL: https://marc.info/?l=linux-crypto-vger&m=144249767024990&w=2 Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* README_distro_proposal.txt: writeup about runit adoptionGravatar Denys Vlasenko2016-12-031-0/+291
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* examples: update var_service/README againGravatar Denys Vlasenko2016-10-141-0/+54
| | | | | | Added "ps -AH e" example Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* typo fixes in docGravatar Denys Vlasenko2016-10-141-2/+2
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* examples: update var_service/README againGravatar Denys Vlasenko2016-10-141-5/+13
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* examples: update var_service/READMEGravatar Denys Vlasenko2016-10-141-24/+130
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* examples: add example of a DHCP serverGravatar Denys Vlasenko2016-10-038-0/+91
| | | | | | | As usual, by multiplying directories - "dhcpd_eth0", "dhcpd_wlan1" you can run many servers on different interfaces. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* examples: wpa_supplicant.conf has a wrong field deleted in examplesGravatar Denys Vlasenko2016-09-261-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* examples/var_service/supplicant_if: new service exampleGravatar Denys Vlasenko2016-09-206-0/+83
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* service/fw example: do not ruin $if[], use different nameGravatar Denys Vlasenko2016-07-301-3/+3
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* var_service/fw: optionally flush all netdevs; optionally prefer one 0/0 routingGravatar Denys Vlasenko2016-07-251-12/+36
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* examples: add a useful "see abridged log" script for ntpd service exampleGravatar Denys Vlasenko2016-07-101-0/+4
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* unrpm: clean upGravatar Mike Frysinger2016-04-041-30/+35
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* undeb: clean upGravatar Mike Frysinger2016-04-041-34/+40
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* tweak zcip service exampleGravatar Denys Vlasenko2015-10-241-0/+2
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>