Joachim Nilsson
3428cd48b7
Fix #71 : Add support for enabling/disabling services in /etc/finit.d
...
This patch adds support for enabling and disabling services in
/etc/finit.d/ by adding another subdirectory:
/etc/finit.d/available
Enabled service/run/task stanzas are by convention symlinked
to the parent dir. The initctl tool has three new convenience
commands to facilitate operating with this:
initctl list
initctl enable <CONF>
initctl disable <CONF>
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-06-29 22:23:38 +02:00
Joachim Nilsson
023a881fb9
Enable more compiler warnings by default, except unused parameters
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-06-29 22:23:09 +02:00
Joachim Nilsson
36f38d5a13
initctl: Only append space between args, not at last arg
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-06-29 22:21:33 +02:00
Joachim Nilsson
d4001064a0
configure: Fix hard coded FIFO path, found by previous commit
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-06-11 22:52:09 +02:00
Joachim Nilsson
fffdad7645
configure: Add neat summary of settings, from lldpd
...
Hat tip to @vincentbernat
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-06-11 22:19:54 +02:00
Joachim Nilsson
32612929d9
doc/conditions.md: Attempt to clarify PID file dependency handling
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-06-10 19:49:36 +02:00
Joachim Nilsson
d49683cfb6
TODO: Update and clarify introduction a bit
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-06-10 19:46:19 +02:00
Joachim Nilsson
9ca5ec16af
doc/config.md: Minor refactor to add an Introduction section
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-06-10 19:44:48 +02:00
Joachim Nilsson
7041813966
Update Makefile after service script move
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-06-05 01:08:46 +02:00
Joachim Nilsson
a31ecb32e1
Fix problem with building from a separate build directory
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-06-05 01:07:47 +02:00
Joachim Nilsson
b1ea279940
Move helper script 'service' to contrib/
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-06-05 01:00:40 +02:00
Joachim Nilsson
82172e65fa
Fix indentation
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-06-05 00:56:24 +02:00
Joachim Nilsson
dfedb231dc
Add MIT license badge to README
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-06-05 00:54:45 +02:00
Joachim Nilsson
5f5be8d74e
Merge pull request #73 from westermo/wmo/inetd-remove-ntoh-on-proto
...
inetd: remove ntoh on proto
2017-04-25 13:34:19 +02:00
Joachim Nilsson
06d3161ffe
Merge pull request #72 from abucodonosor/master
...
Some cleanup
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-03-28 18:43:32 +02:00
Joachim Nilsson
cd5348dffd
Add a set of contributing guidelines
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-03-21 07:58:57 +01:00
Joachim Nilsson
6e4b698fac
Add Code of Conduct document
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-03-21 07:49:19 +01:00
Joachim Nilsson
c135a83cb3
Check if /proc/bus/usb exists before trying to mount it
...
Most newer kernels have usbfs disabled by default.
See issue #69 for details.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-03-20 20:41:09 +01:00
Joachim Nilsson
37d391d53a
doc/build.md: Remove mention of --enable-embedded configure option
...
As suggested in GitHub issue #68 .
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-03-17 16:55:02 +01:00
Joachim Nilsson
d335c9833c
It is difficult to write readable technical text.
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-03-08 16:25:14 +01:00
Joachim Nilsson
ab7df43ccb
Clarify link target a bit
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-03-08 16:17:05 +01:00
Joachim Nilsson
ead92b3a27
Fix Markdown link
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-03-08 16:15:52 +01:00
Joachim Nilsson
647a79ffbd
README: Add explanation of service early and link to doc/config.md
...
Also, update the service help text in doc/config.md to include info on
both runlevels and explain the condition in the listed example.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-03-08 16:09:40 +01:00
Joachim Nilsson
47793dcdf2
sm.c: Add missing header
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-03-08 08:26:13 +01:00
Joachim Nilsson
9df0454b64
initctl: Support for utmp show FILE
...
This patch adds support for showing a log rotated (uncompressed)
UTMP/WTMP file in initctl.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-02-10 11:44:57 +01:00
Joachim Nilsson
5ea1ac7582
Followup to #66 : Gzip log files >= .2
...
This patch to the logrotate() function extends the log rotattion of a
file with a gzip of .2 and older log files. If gzip is not available
in $PATH then @num files are left uncompressed.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-02-10 11:00:17 +01:00
Joachim Nilsson
9f7604848c
initctl: Remove no longer neede source files from build
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-02-10 10:21:27 +01:00
Joachim Nilsson
bbbaba7b47
Minor cleanup
...
initctl: Replace daemon-only API from user tool
utmp-api.c: Remove not needed header
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-02-10 10:20:29 +01:00
Joachim Nilsson
d56031db7d
svc.c: Replace daemon-only logging API with API from err.h
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-02-10 10:19:00 +01:00
Joachim Nilsson
0f64e18f27
Relocate utmp_show() to initctl.c
...
Only used by this tool, no need to keep it in the shared utmp-api.c
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-02-10 10:17:41 +01:00
Joachim Nilsson
958cab8cc7
Relocate runlevel_string() to initctl.c
...
Only used by this tool, no need to keep it in helpers.c
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-02-10 10:11:52 +01:00
Joachim Nilsson
9974d65756
Fix #66 : Rotate /var/log/wtmp log max:2, size:100k
...
This patch adds a simple log-rotate function to the UTMP, WTMP, BTMP,
and lastlog files. Enabled by default, disable with:
configure --disable-logrotate
Even though it can rotate /run/utmp it is unlikely this file will grow
that much during a system's uptime.
The hard-coded defaults are to keep up to two (2) previous versions
of the files and rotate on file size >= 100k.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-25 19:40:06 +01:00
Joachim Nilsson
a0e17c8f47
Relocate create() from bootmisc plugin to helpers.h
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-25 19:40:06 +01:00
Joachim Nilsson
f76268dec9
initctl: Fix build warnings after de4bf53
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-24 09:15:30 +01:00
Joachim Nilsson
8d74a12628
Fix #64 : Skip fsck of already mounted devices
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-24 08:03:53 +01:00
Joachim Nilsson
33ae64495a
finit.c: Mount /proc and /sys before fsck()
...
For issue #64 we need to have /proc/mounts, or /etc/mtab but that's
usually symlinked to /proc/mounts.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-24 07:57:19 +01:00
Joachim Nilsson
750712d28d
Merge pull request #63 from mattiaswal/add-cond-dump
...
initctl: Add 'initctl cond dump' to show all conditions in the system
2017-01-18 19:06:48 +01:00
Joachim Nilsson
205db919f5
Move service script: $PREFIX/bin --> $PREFIX/sbin
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-16 07:43:24 +01:00
Joachim Nilsson
9b5d12bf22
Install service script wrapper in $PREFIX/bin
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-16 07:37:55 +01:00
Joachim Nilsson
3b53dfcaed
configure: Simplify description
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-16 07:37:34 +01:00
Joachim Nilsson
1d39decaf1
Update .gitignore files
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-16 07:32:09 +01:00
Joachim Nilsson
8129ea32aa
Remnant of GIT submodule era
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-16 07:25:03 +01:00
Joachim Nilsson
2bf024d3c3
Remnant of the old build system
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-16 07:23:44 +01:00
Joachim Nilsson
19d89d627b
Add src/.gitignore
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-16 01:35:06 +01:00
Joachim Nilsson
fff68b7b06
Relocate source files to an src/ subdirectory
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-16 01:31:02 +01:00
Joachim Nilsson
044ded3045
Fix #61 : Reassert net/* conditions after initctl reload
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-16 01:09:06 +01:00
Joachim Nilsson
0cccc629bf
pidfile: Ensure svc is always followed by a slash
...
A service need no longer be fully qualified path.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-16 01:02:40 +01:00
Joachim Nilsson
57181264e9
pidfile: Make sure to set a default name for plugin
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-16 01:02:16 +01:00
Joachim Nilsson
0b5888ed22
cond.c: Use utimensat() instead of utime() for nanosecond precision
...
We have repeatedly seen use-cases when sub-second resolution for
updatating the mtime of files have been needed. Yes, all those
cases have been Autobots.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-16 01:00:10 +01:00
Joachim Nilsson
4321038518
bootmisc: Minor refactor
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-16 00:59:32 +01:00
Joachim Nilsson
b84e32a6fe
Add initctl log [SVC] command
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-15 23:21:19 +01:00
Joachim Nilsson
21a293beae
Fix #60 : initctl start/stop/restart ignores non-existing services
...
This patch improves the error handling of initctl so that it returns
non-zero if a service does not exist.
$ initctl <start|stop|restart> SVC
$ echo $?
1
In verbose mode an error message is also returned:
$ initctl -v <start|stop|restart> SVC
No such service SVC
$ echo $?
1
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-15 23:15:10 +01:00
Joachim Nilsson
47b4850aa8
api.c: Factor out SVC|JOB:ID string parser
...
This patch breaks out the JOB:ID parser from api.c, placing it in a new
function called svc_parse_jobstr().
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-15 23:12:53 +01:00
Joachim Nilsson
1999956d91
fixup! API: Show debug level in log after initctl debug
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-15 23:07:27 +01:00
Joachim Nilsson
698f736b65
Relocate and export sanitize() function
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-15 23:06:45 +01:00
Joachim Nilsson
618744cc52
fixup! Fix compiler warnings after do_sleep() relocation
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-15 23:05:06 +01:00
Joachim Nilsson
67125fedab
API: Show debug level in log after initctl debug
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-15 21:16:31 +01:00
Joachim Nilsson
f7cd46abc9
API: Check input argument
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-15 21:15:58 +01:00
Joachim Nilsson
9f62153966
Whitespace: reindent and relocate function declaration(s)
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-15 20:53:13 +01:00
Joachim Nilsson
978771a3fb
Fix compiler warnings after do_sleep() relocation
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-15 20:19:44 +01:00
Joachim Nilsson
adc340e4c3
reboot: Use do_sleep() instead of sleep() to prevent wakeups due to SIGTERM
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-13 07:56:48 +01:00
Joachim Nilsson
50668161ad
Move do_sleep() from helper.c --> util.c
...
This move makes it possible to share the code between the Finit daemon
and its client tools.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-13 07:55:44 +01:00
Joachim Nilsson
6507136bdd
reboot: Mention why CMD_SUSPEND is not managed in regular flow
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-13 07:54:48 +01:00
Joachim Nilsson
5cdbd57875
reboot: Ignore SIGTERM at halt/poweroff
...
We want to emulate the behavior of the reboot() syscall on success.
Primarily for a coherency/symmetry, but also to prevent printing
a new shell prompt in the middle of system shutdown messages.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-13 07:48:00 +01:00
Joachim Nilsson
1550c34d65
reboot: Simplify applet transformation.
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-13 07:47:29 +01:00
Joachim Nilsson
ec6e3bc9e7
TODO: Minor update/clarification
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-11 17:45:13 +01:00
Joachim Nilsson
d5942f3267
Minor whitespace fixes
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-11 17:40:10 +01:00
Joachim Nilsson
e272710e36
Merge pull request #62 from mattiaswal/fix-fluxstate
...
Fix fluxstate
2017-01-11 17:21:27 +01:00
Joachim Nilsson
f95cd38ddb
Refactor #ifndef INETD_DISABLED --> #ifdef INETD_ENABLED
...
This patch changes the confusing logic in all #ifndef INETD_DISABLED
statements to instead be #ifdef INETD_ENABLED, which is quite a bit
more readable.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-12-30 13:34:31 +01:00
Joachim Nilsson
d9de2717a2
Merge pull request #59 from reverendhomer/master
...
run: fix array overflow
2016-12-30 11:40:11 +01:00
Joachim Nilsson
0946dbb287
Merge pull request #58 from reverendhomer/master
...
Another typo fix :)
2016-12-29 10:52:00 +01:00
Joachim Nilsson
3fac6ed6af
Merge pull request #57 from reverendhomer/master
...
fix typo in config.md
2016-12-26 20:13:42 +01:00
Joachim Nilsson
de05070ccc
tty: Debug messages when TTY is not started
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-12-25 10:35:51 +01:00
Joachim Nilsson
f68daf1b14
Update ChangeLog with -rc2 fixes
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-12-24 09:43:09 +01:00
Joachim Nilsson
88039f3d65
Fix #56 : Check TTY before trying to start getty
...
This (initial) patch for issue #56 adds a very basic validation of the
device before attempting to start a getty on it.
TODO: Verify a USB/serial device can be plugged in at any point at
runtime, either automatically start getty or by `initctl reload`
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-12-23 23:11:53 +01:00
Joachim Nilsson
2c0421f2e6
Fix #54 : Allow halt and poweroff despite --enable-watchdog
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-12-13 20:36:34 +01:00
Joachim Nilsson
a672988e35
Merge branch 'fix-mpc85xx-getty-regression'
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-12-12 22:30:08 +01:00
Joachim Nilsson
f335e74cb8
Add missing #include <signal.h>, non GLIBC targets
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-12-09 07:29:45 +01:00
Joachim Nilsson
83915b42f3
Bump version for 3.0-rc2, second pre-release
...
All known major issues triaged or fixed.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-12-09 01:03:18 +01:00
Joachim Nilsson
babcd117b1
Fix #43 : Add TODO for optimizing HTTP/HTTPS inetd redirect
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-12-09 00:56:39 +01:00
Joachim Nilsson
892ac2edb2
Fix #47 : Relocate sysctl.conf setup to procps plugin
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-12-08 08:17:38 +01:00
Joachim Nilsson
5b12d17b56
Fix #52 : Add implicit "initctl reload" adter run-parts and rc.local
...
This patch (untested) patch calls `service_reload_dynamic()` after both
run-parts (if directory exists) and after `/etc/rc.local` has run. The
intention is to reload any services modified/added/removed by a user
script so the system is properly up to date.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-12-08 01:43:32 +01:00
Joachim Nilsson
1b6930126e
Fix #50 : Reset TTY properly in stty()
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-12-08 01:38:05 +01:00
Joachim Nilsson
8def97a465
Add missing ctype.h header for whitespace stripper
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-12-08 01:37:56 +01:00
Joachim Nilsson
7bbc0847b1
Unblock udp/wait parent inetd service on child exit
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-12-07 23:31:54 +01:00
Joachim Nilsson
88dc3f0061
Strip leading whitespace from service -- description
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-12-07 22:09:51 +01:00
Joachim Nilsson
02e69932ae
Fix inetd regression introduced in 10b72f1
...
This patch allows all services to go from READY -> RUNNING, this to
prevent started inetd connections from being treated as "stubborn"
and inadvertently killing them off after a few seconds.
The same actually applies to run/task applications.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-12-07 21:51:54 +01:00
Joachim Nilsson
662dfbe777
Travis-CI: Update libuEv build dependency
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-12-05 08:43:48 +01:00
Joachim Nilsson
c249cbdbe1
Remove duplicate header
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-12-05 08:40:29 +01:00
Joachim Nilsson
a47171891f
fixup! Make blocked state more generic
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-12-05 08:40:07 +01:00
Joachim Nilsson
1dc67acd40
chargen: Make sure to check target buffer size
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-12-05 08:37:41 +01:00
Joachim Nilsson
146685c2c2
Fix inverted --enable-quiet option
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-12-03 06:15:46 +01:00
Joachim Nilsson
3cc2df20f9
Update minimum libuev requirement, v1.5.2
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-11-27 20:39:36 +01:00
Joachim Nilsson
4f3d246100
Make blocked state more generic
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-11-27 20:38:50 +01:00
Joachim Nilsson
11bfec1a23
Add missing header include guards
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-11-27 17:38:39 +01:00
Joachim Nilsson
f24a03a32c
Refactor little progname() for all applictions
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-11-27 17:38:01 +01:00
Joachim Nilsson
829ff0b9f7
Fix #51 : Catching SIGSEGV not needed anymore
...
This patch fixes issue #51 by reverting b4b63d3 , which is not needed
anymore since service callbacks have been removed from Finit3.
The `sig_unblock()` function, called for each forked off child, should
now be balanced with caught signals.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-11-27 17:28:15 +01:00
Joachim Nilsson
b9ae4d04ef
bootmisc: Replace homegrown desym() with realpath()
...
Followup to issue #49 .
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-11-21 15:01:59 +01:00
Joachim Nilsson
47060c9738
bootclean: Resolve any symlinks in tmpfs check
...
Followup to issue #49 .
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-11-21 09:41:30 +01:00
Joachim Nilsson
846692ca03
Fix #49 : Skip tmpfs directories at bootclean
...
We can safely skip tmpfs, nothing to clean from previous boot there.
In fact, if we clean it we may spoil things for udev, which saves
pre-boot files in /run/udev.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-11-20 19:29:42 +01:00