Joachim Nilsson
d40f52357e
Restructure and add section on Watchdog process supervision
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2015-01-06 21:45:14 +01:00
Joachim Nilsson
076f77a31b
Update TODO: more on inetd and at support.
...
Also a minor fix to the README.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2015-01-06 20:54:52 +01:00
Joachim Nilsson
8f1c16a8a5
Update TODO with section on Cron.
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2015-01-01 02:04:50 +01:00
Joachim Nilsson
b149dbc73e
Update TODO
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2015-01-01 00:11:44 +01:00
Joachim Nilsson
aa8d6a7294
Bump version for 1.10 release.
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2014-11-27 22:33:24 +01:00
Joachim Nilsson
a94dde403f
Update NEWS to Markdown syntax and add info on next release.
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2014-11-27 09:42:49 +01:00
Joachim Nilsson
9bb7e7b014
Change NEWS documentation from reST to Markdown
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2014-11-27 09:19:33 +01:00
Joachim Nilsson
02a97e8d7d
Fix various problems with unchecked return values from syscalls.
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2014-11-27 00:12:07 +01:00
Joachim Nilsson
def759fe41
run_interactive(): Fix a potential file descriptor leak.
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2014-11-26 23:45:20 +01:00
Joachim Nilsson
939cfc2476
pidfile_read(): Reindent.
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2014-11-26 23:44:00 +01:00
Joachim Nilsson
7f2c73468f
libite/rsync.c: Fix build regression from previous commit.
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2014-11-26 23:37:04 +01:00
Joachim Nilsson
81a368f710
Fix problem with unchecked return value of mkdir(), wrap in makedir() macro.
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2014-11-26 23:27:15 +01:00
Joachim Nilsson
4e975e4974
plugin.c:load_one() - Comment on resource leak, we never unload plugins atm.
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2014-11-26 23:24:49 +01:00
Joachim Nilsson
a296c2dd00
pidfile_read(): Fix potential integer overflow when reading PID
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2014-11-26 23:02:54 +01:00
Joachim Nilsson
5ff7994852
touch(): Check return value of mknod(), report error if errno != EEXIST.
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2014-11-26 22:57:23 +01:00
Joachim Nilsson
1bdcef9a2c
run_interactive(): Fix file descriptor leak when debug is enabled.
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2014-11-26 22:49:31 +01:00
Joachim Nilsson
f621117eb9
README: Update section on plugins with info on hooks and I/O plugins.
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2014-11-26 18:48:25 +01:00
Joachim Nilsson
83cec7129a
run_interactive(): Fix copy-paste bug introduced in 06b33c5.
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2014-11-26 17:58:50 +01:00
Joachim Nilsson
06b33c58fd
run_interactive(): Fix descriptor leak.
...
Make sure to close dup()'ed descriptors when we're done with them.
Thanks to Coverity Scan for finding this nasty one!
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2014-11-26 17:30:58 +01:00
Joachim Nilsson
8ce39f592c
procname_kill(): Fix possible resource leak and let's use opendir() errno
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2014-11-26 17:22:55 +01:00
Joachim Nilsson
d37c451e81
svc_start(): Fix out of bounds write to args[] array.
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2014-11-26 17:20:27 +01:00
Joachim Nilsson
a7ff1a61d5
svc_start(): Fix swapped arguments to dup2() and add close(fd), descriptor leak.
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2014-11-26 17:17:47 +01:00
Joachim Nilsson
8349909f60
helpers.c:run_interactive() - Check arguments and return values better.
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2014-11-26 17:08:00 +01:00
Joachim Nilsson
3a2cf30f47
README: Minor touch up.
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2014-11-26 16:41:04 +01:00
Joachim Nilsson
9a3cab3645
TODO: Remove finished items now documented in README
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2014-11-26 16:40:43 +01:00
Joachim Nilsson
7dbc02f879
Standardize on two-space indented * for bullet lists in Markdown
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2014-11-26 16:13:53 +01:00
Joachim Nilsson
a39f75744c
Update TODO to Markdown syntax.
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2014-11-26 16:08:59 +01:00
Joachim Nilsson
5742c6591a
Change TODO documentation from reST to Markdown
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2014-11-26 15:59:34 +01:00
Joachim Nilsson
588901ee4c
Update README to Markdown syntax.
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2014-11-26 15:56:50 +01:00
Joachim Nilsson
e30d2aae19
Change documentation from reST to Markdown
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2014-11-26 15:55:33 +01:00
Joachim Nilsson
463e4f12f8
Update Coverity URL and add section on hooks, plugins & callbacks.
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2014-11-24 18:21:47 +01:00
Joachim Nilsson
01c2817005
Add support for Coverity Scan
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2014-11-24 13:49:18 +01:00
Joachim Nilsson
1a16aab970
queue.h: Upgrade to a newer slightly bugfiex version of OpenBSD queue.h
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2014-11-03 20:56:11 +01:00
Joachim Nilsson
8247344f0d
helpers.c:set_hostname() - Fix resource and memory leaks.
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2014-10-31 15:26:49 +01:00
Joachim Nilsson
2fdd64a2d8
helpers.c:run() - Fix resource and memory leaks.
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2014-10-31 15:16:00 +01:00
Joachim Nilsson
22ed4e7f73
svc.c - Break out nested function.
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2014-10-31 14:58:13 +01:00
Joachim Nilsson
327ac9f931
libite:rsync.c - Break out nested function.
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2014-10-31 14:56:51 +01:00
Joachim Nilsson
5ad0c38fe8
Sanity check plugpath as well, no point in searching for plugins otherwise.
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2014-10-30 22:11:23 +01:00
Joachim Nilsson
757911f149
Bump version for release and update copyright years.
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2014-04-21 16:03:54 +02:00
Joachim Nilsson
35b771fb42
Add empty space for formatting.
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2014-04-21 15:51:33 +02:00
Joachim Nilsson
720f1b0e5b
Strip output when loading .conf files.
...
If not standard finit.conf, then we want to show just the base name.
E.g., loading first /etc/finit.conf then /etc/finit.d/services.conf
Loading configuration ............. vs
Loading services configuration ....
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2014-04-21 15:46:09 +02:00
Joachim Nilsson
292a3be515
lite.h: Add some helper string comparison methods.
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2014-04-21 15:45:23 +02:00
Joachim Nilsson
5ed407e493
helpers.c: Fix mix of off-by-one errors in new print() code.
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2014-04-21 14:09:23 +02:00
Joachim Nilsson
40988b901c
Unify print_desc() & print_result() in print() and refactor ...
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2014-04-21 14:05:56 +02:00
Joachim Nilsson
26d49b2027
Yet another minor bugfix to new include function.
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2014-04-21 12:05:55 +02:00
Joachim Nilsson
10386ee4de
Bug fix and document new include <CONF> syntax.
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2014-04-21 12:03:10 +02:00
Joachim Nilsson
773d2e65d6
README: Update docs on extended syntax and behavior for tty setting
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2014-04-21 11:17:31 +02:00
Joachim Nilsson
3e29d883fa
tty.c:tty_start() - Fix strcmp() foobar from f6f2895, must use strncmp()
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2014-04-21 11:08:34 +02:00
Joachim Nilsson
f6f2895524
Add support for a fallback shell if no tty is setup
...
Try to do better by the user, by default, if no tty is specified in the
finit.conf. This way the user will at least have a way to interact with
the system and repair it.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2014-04-19 22:58:20 +02:00
Joachim Nilsson
62287f8fcc
Add support for including .conf files.
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2014-04-19 22:56:19 +02:00
Joachim Nilsson
be3257f805
print_desc() - Allow arguments to be NULL.
...
Signed-off-by: Joachim Nilsson <joachim.nilsson@westermo.se >
2014-04-19 22:25:56 +02:00
Joachim Nilsson
1bf3aa528a
Fix duplicate link and cleanup contact section.
...
Signed-off-by: Joachim Nilsson <joachim.nilsson@westermo.se >
2014-04-19 19:31:00 +02:00
Joachim Nilsson
056236c9f8
Freshen up README, TODO, and .conf example, spell check.
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2014-04-19 19:19:57 +02:00
Joachim Nilsson
71fff76111
svc.[ch]: Fix possible out of bounds and NULL ptr deref
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2014-04-12 16:41:20 +02:00
Joachim Nilsson
1095724e5c
libite: Fix cppcheck warnings in rsync unit test
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2014-04-12 16:34:57 +02:00
Joachim Nilsson
e81c2f2f90
libite: Minor style cleanup of fsendfile()
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2014-04-12 16:21:41 +02:00
Joachim Nilsson
9f91b4c050
libite: Simplify and fix another memleak in copyfile()
...
- Simplify: reduce indentation depth
- Always check for error condition first, cleaner code
- Make sure buffer is always freed, use same exit everyhere
- Use readable, but still short, local variable names
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2014-04-12 16:11:59 +02:00
Joachim Nilsson
7ada824e3e
Makefile: Add support for make check to run cppcheck
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2014-04-12 16:08:30 +02:00
Joachim Nilsson
7cf7591f0a
run_getty(): Handle STDIO descriptors better.
...
The cppcheck tool raised an alert to the missing close() for
stdin when a console is opened for a getty. This patch fixes
that warning and also makes the code slighlty more readable.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2014-04-12 15:15:43 +02:00
Joachim Nilsson
143a257c25
libite: Copy utility fixes and new functionality
...
- Add support for symlinks to copyfile()
- Fix memory leak in copy_filep()
- New function, fsendfile(), copy data between FILE streams
Also, minor whitespace and coding style cleanup.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2014-04-12 15:08:56 +02:00
Joachim Nilsson
1d98647c54
Add missing include for system header file
...
Only affects externally built plugins.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2014-04-12 14:31:31 +02:00
Joachim Nilsson
7cd52b36a1
Always print service start/stop at start of line
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2014-04-12 14:30:34 +02:00
Joachim Nilsson
b033052647
TODO: Further simplify example inetd syntax.
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2014-04-10 10:34:06 +02:00
Joachim Nilsson
4fcf2533a6
Minor indentation fix to TODO.
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2014-04-10 10:29:06 +02:00
Joachim Nilsson
a8a103a521
Update TODO with inetd proposal, and minor README cleanup.
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2014-04-10 10:26:46 +02:00
Joachim Nilsson
12b09bb80b
Improve CI status integration in README and minor cleanup.
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2014-02-25 09:23:16 +01:00
Joachim Nilsson
49aaffcf9a
Update README with CI status.
2014-02-25 00:00:43 +01:00
Joachim Nilsson
afbe628f17
Travis CI integration
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2014-02-24 23:46:28 +01:00
Joachim Nilsson
1d6cbe31fe
Initial support for restarting lost processes during norespawn
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2014-02-24 23:33:38 +01:00
Joachim Nilsson
d7598ca672
Update URL of example to new download FTP.
2013-06-08 15:37:31 +02:00
Joachim Nilsson
ff8e494abd
Update README with a slightly more clear and catchy intro.
2013-06-08 14:49:28 +02:00
Joachim Nilsson
dfaa6dd3f8
Minor ReST syntax fix for improved display in GitHub
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2013-06-08 11:23:24 +02:00
Joachim Nilsson
849f3fbb28
Explain finit.conf commands more in README, update example .conf
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2013-06-07 14:09:46 +02:00
Joachim Nilsson
329acf24bb
Bump version and start preparing docs for release of 1.8
...
Renamed ChangeLog to NEWS and fixed doc style to use ReST, like the
README and TODO files.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2013-06-07 09:16:00 +02:00
Joachim Nilsson
bf40278131
Delay start of TTYs to let system stabilize at boot.
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2013-06-06 18:19:27 +02:00
Joachim Nilsson
4f2cf52eff
Minor cleanup.
2013-06-06 18:19:27 +02:00
Joachim Nilsson
f96fb855ce
tty: Clear PID to be able to respawn it.
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2013-06-06 18:19:27 +02:00
Joachim Nilsson
65f0be8a55
Simplify banner further, let distributions patch us instead.
...
Revert crazy BANNER macro idea from 5ba7bc1 . It is simply too difficult to
set -DBANNER='"Some distributions specific text"' in a parent Makefile
without entering Shell/Make escape hell ... instead, downstream will
have to patch the banner() function.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2013-06-06 18:19:26 +02:00
Joachim Nilsson
bcfcafdb7c
tty: Use calloc() instead of malloc() to prevent uninitialized errors.
...
On some platforms GCC does not zero the heap. This can lead to
serious problems, e.g., tty->pid may be non-zero while never
having been started.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2013-06-06 18:19:26 +02:00
Joachim Nilsson
c57bd066d1
Build fix, if ROOTDIR was set linking failed. Use TOPDIR internally.
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2013-06-06 18:19:26 +02:00
Joachim Nilsson
4171fbdfd3
Store RUN_LVL in UTMP and change RUNLEVEL_BOOT from 10 to 0
...
Standard init implementations save current and previous runlevels
in utmp, now finit does too. Also, the initial runlevel at boot
has changed from 10 to the more obvious 0.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2013-06-06 18:19:26 +02:00
Joachim Nilsson
0f60aa2289
Refactor TTY code to honor runlevels and use I/O plugin to watch /dev
...
Add support for runlevels to tty command and support for reading baud
rate and TERM variable from finit.conf.
The tty-watcher thread has been converted to a standard I/O plugin.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2013-06-06 18:19:26 +02:00
Joachim Nilsson
f97aab4699
Rename stat_restart_counter --> restart_counter
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2013-06-06 18:19:18 +02:00
Joachim Nilsson
740d447442
Update Debian 6.0 example /etc/finit.conf and /etc/finit.d
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2013-06-04 13:12:53 +02:00
Joachim Nilsson
6448d6ccfa
Coding style and whitespace fixes
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2013-06-04 09:25:11 +02:00
Joachim Nilsson
25cc9f3b9b
Improve runlevel support by adding a bootstrap phase, also adds task/run cmd
...
Most systems need an early bootstrap phase for one-shot tasks and
necessary one-time probing. This phase usually runs well before any
networking is setup. This commit adds support for that 'S' runlevel,
and also extends the number of possible total runlevels to nine.
For the one-shot tasks that run in bootstrap two new finit.conf cmds
have been added:
- task: For one-shot tasks that can be started in parallell
- run: For one-shot tasks that must run in sequence
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2013-06-04 09:25:05 +02:00
Joachim Nilsson
e776838de9
Rename USE_UDEV & MDEV to SETUP_DEVFS and USE_MESSAGE_BUS to HAVE_DBUS
...
USE_UDEV,MDEV => Unique SETUP_DEVFS for embedded or distro usage.
USE_MESSAGE_BUS => HAVE_DBUS
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2013-06-04 07:21:08 +02:00
Joachim Nilsson
bf0cfe0693
Update and clarify TODO items, e.g., add info on new "task" and "run" stanzas
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2013-06-04 07:21:00 +02:00
Joachim Nilsson
f690767507
Refactor .conf file parser and add support for runlevel N
...
This commit is a refactor of how arguments to finit.conf file settings
are parsed. Not all settings are run directly, but only need the arg
for future use. The code should be a lot easier to understand now.
Also, added support for specifying the desired runlevel in finit.conf
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2013-05-22 12:42:56 +02:00
Joachim Nilsson
4d57b14b5b
Bugfix chomp() and set_hostname()
...
chomp():
Removed first \n instead of last \n
set_hostname():
If /etc/hostname exists we need to realloc the size of
the current hostname variable. Also, only try to set
the hostname if !NULL
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2013-05-22 12:41:59 +02:00
Joachim Nilsson
263036045a
tty: Check input arguments for invalid tty before adding.
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2013-05-22 12:36:19 +02:00
Joachim Nilsson
56ef3f75d3
Build: Make subdir build prettier.
...
The ROOTDIR variable was only set in the top-level Makefile,
so when building from a subdirectory the output was slightly
garbled. Moved ROOTDIR declaration to common.mk.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2013-05-22 06:18:52 +02:00
Joachim Nilsson
d0c902ab78
libite: Add strtonum() from OpenBSD
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2013-05-21 19:55:41 +02:00
Joachim Nilsson
5ba7bc1fdf
Cleanup and simplify boot process messages
...
- Remove indentation of module loading and device node creation
- Clarify that we load kernel modules
- Clarify that we load Finit plugins
- Remove cls()
- Remove verbose condition for echo()
- Make banner a separate function with optional distribution banner
- Add a few neat ANSI escape sequences for cls(), clreol(), delline(), etc.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2013-05-21 12:52:06 +02:00
Joachim Nilsson
7e9ac7ba67
Fix indentation and ReST syntax.
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2013-05-20 15:32:04 +02:00
Joachim Nilsson
e2eaee9620
TODO: Add entry on mimicing Debian SysV init rcS.d, runs once at boot.
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2013-05-20 15:25:14 +02:00
Joachim Nilsson
b23ce7ab8e
Update TODO
...
More inspiration and courage from the launchd Google Talk video!
Fascinating stuff about replacing init/inetd/cron/watchdogd that
I've been thinking about for ages!
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2013-05-19 23:39:23 +02:00
Joachim Nilsson
53127a7ce6
Update TODO
...
Move to use ReST syntax, like README, and update to reflect current
status of project.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2013-05-19 19:01:45 +02:00
Joachim Nilsson
011b73ba39
Fix issue with "Formatting of boot text changes in the middle of the boot."
...
This commit adds a line: "Loading kernel modules ..." before increasing
indentation level of module loading messages.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2013-05-19 19:01:45 +02:00
Joachim Nilsson
c3b76fdccf
Add basic support for runlevels and bugfix FIFO I/O plugins
...
Like most other init implementations do, when entering runlevel 1, finit
creates the file /etc/nologin to prevent users from logging in during
single-user mode, this file is then removed upon leaving runlevel 1.
Also, bugfix how FIFO I/O plugins are handled in finit. A FIFO will
need to be reopened by the server side when the client closes the pipe.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2013-05-19 19:01:44 +02:00