aboutsummaryrefslogtreecommitdiff
path: root/examples/var_service (follow)
Commit message (Collapse)AuthorAgeFilesLines
* examples/var_service/dhcp_if: make helper scripts more talkativeDenys Vlasenko2022-05-124-10/+16
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* examples/var_service/fw/run: allow extif's to be more than one ifaceDenys Vlasenko2021-09-021-8/+12
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* examples/var_service: use "exec sleep 5" instead of "{ sleep 5; exit; }"Denys Vlasenko2019-04-215-5/+5
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* service examples: if iface do not exist, retry upping itDenys 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 statementDenys 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 routerDenys Vlasenko2019-02-051-0/+19
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* service examples: do not respawn supplicant too oftenDenys Vlasenko2019-02-021-1/+2
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* service examples: ifplugd -M to prevents frequent respawningDenys Vlasenko2019-01-181-1/+2
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* examples/var_service: add /var/run flag file to ntp.scriptDenys Vlasenko2018-07-261-1/+3
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* examples/var_service/: use standard logger script, viewer and pager scriptsDenys Vlasenko2018-07-0351-383/+81
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* examples/var_service/: use "svc" for service commands, other tweaksDenys Vlasenko2018-07-038-30/+35
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* examples: update /var/service/getty for Unicode ttysDenys Vlasenko2018-06-235-194/+206
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* tweak /var/service exampleDenys Vlasenko2018-05-201-9/+14
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* setlogcons: open /dev/ttyN for "setlogcons N", not /dev/tty1Denys Vlasenko2018-04-161-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* examples/var_service: new example: dnsmasq serviceDenys Vlasenko2018-03-307-0/+165
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* svok: new applet (daemontools compat)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 startupDenys Vlasenko2018-03-301-8/+9
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* udhcpd: fix "not dying on SIGTERM"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/*Denys Vlasenko2017-07-272-7/+9
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* fix more instances of ": $((a++))" in shell scriptsDenys Vlasenko2017-07-151-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Spelling fixes in comments, documentation, tests and examplesDenys Vlasenko2017-04-171-1/+1
| | | | | | By klemens <ka7@github.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* README_distro_proposal.txt: typo fixesTito 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.txtDenys Vlasenko2016-12-251-14/+21
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* README_distro_proposal.txt: writeup about runit adoptionDenys Vlasenko2016-12-031-0/+291
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* examples: update var_service/README againDenys Vlasenko2016-10-141-0/+54
| | | | | | Added "ps -AH e" example Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* typo fixes in docDenys Vlasenko2016-10-141-2/+2
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* examples: update var_service/README againDenys Vlasenko2016-10-141-5/+13
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* examples: update var_service/READMEDenys Vlasenko2016-10-141-24/+130
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* examples: add example of a DHCP serverDenys 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 examplesDenys Vlasenko2016-09-261-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* examples/var_service/supplicant_if: new service exampleDenys Vlasenko2016-09-206-0/+83
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* service/fw example: do not ruin $if[], use different nameDenys 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 routingDenys 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 exampleDenys Vlasenko2016-07-101-0/+4
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* tweak zcip service exampleDenys Vlasenko2015-10-241-0/+2
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Tweak READMEDenys Vlasenko2015-10-241-4/+4
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* update network service examplesDenys Vlasenko2015-10-2417-20/+55
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* New example of a service: examples/var_service/zcip_ifDenys Vlasenko2015-10-247-0/+122
| | | | | | Zeroconf for IPv4 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* better pinger service exampleDenys Vlasenko2015-10-151-10/+34
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* update example ntp.scriptDenys Vlasenko2015-03-311-2/+19
| | | | | | | Handle an interesting corner case when NTP server is reachable... but on a different IP now. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Improve examples/var_service READMEsDenys Vlasenko2014-02-2113-2/+71
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* fix typo in READMEDenys Vlasenko2010-12-081-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* typo fixDenys Vlasenko2010-12-061-1/+1
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* update examples/var_service/READMEDenys Vlasenko2010-12-061-0/+5
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* add examples/var_service/READMEDenys Vlasenko2010-12-061-0/+54
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* whitespace fixDenys Vlasenko2010-01-261-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ntpd: explain why scripts can be run in quick successionDenys Vlasenko2010-01-251-6/+14
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* whitespace fixesDenys Vlasenko2010-01-251-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* fix examples which used non-standard cut -b0-NNNDenys Vlasenko2010-01-187-7/+7
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* examples: add example ntpd serviceDenys Vlasenko2010-01-135-0/+118
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>