Commit Graph
592 Commits
Author SHA1 Message Date
Joachim Nilsson 44579cc089 README: Clarify how arguments to ./configure --with-plugins= work
This should help clarify any misunderstandings detailed in issue #13.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-10-22 15:19:01 +02:00
Joachim Nilsson da361f460d Update ChangeLog slightly, off by one fix
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-10-16 20:56:56 +02:00
Joachim Nilsson bc2cb21005 Update version links.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2.1
2015-10-16 20:46:34 +02:00
Joachim Nilsson e1169628ce Update ChangeLog and bump version for v2.1 release
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-10-16 20:44:47 +02:00
Joachim Nilsson 48b420b757 Simplify execution and _exit() of service callback.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-10-16 19:45:09 +02:00
Joachim Nilsson 9796809907 Merge pull request #12 from westermo/wkz/sighup-fix
Unblock blocked signals after forking off a child
2015-10-16 18:42:47 +02:00
Tobias Waldekranz a3193b34a6 Unblock blocked signals after forking off a child
After forking off a new child, all signals that are blocked by finit
should be unblocked before exec-ing the final binary. Also, finit now
blocks SIGHUP, so add it to the set of signals that should be
unblocked.
2015-10-16 18:32:53 +02:00
Joachim Nilsson c0af01db6d Upgrade libite (LITE) to v1.1.1
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-10-10 17:36:24 +02:00
Joachim Nilsson 3c1c7df420 Default to -O2, not -Os, and use CPPFLAGS for includes, not CFLAGS.
We should not use -Os as default optimization, it is sometimes unstable
in cross compilers.  Instead, default to -O2, which is the more tried
and tested path.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-10-10 17:34:31 +02:00
Joachim Nilsson 258efd4101 Cleanup, minor bug fixes and silencing of netlink plugin.
Patch courtesy of Westermo.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-10-08 19:59:19 +02:00
Joachim Nilsson 5e33647f80 Fix too small MAX args in initctl and too few args in svc_t
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-10-07 21:03:35 +02:00
Joachim Nilsson d2f23e281f Allow Finit to set hostname at dynamic reload.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-10-06 19:35:02 +02:00
Joachim Nilsson b5e3e69553 Do not allow VERSION to be overloaded by build system.
When integrating finit as a component in another system, that build
system may set VERSION as an environment variable for that OS -- we do
not want that version to be set as the version of finit.

Also, bump version to 2.0.1-dev for upcoming patch release cycle.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-10-02 15:09:07 +02:00
Joachim Nilsson 8d85e59214 Optimization is a CFLAG, not a CPPFLAG
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-09-29 22:39:49 +02:00
Joachim Nilsson a1c8ada320 Play around a bit with project title heading.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-09-29 22:39:19 +02:00
Tobias Waldekranz ae15988eb8 Add hook point on fstab mount failure
Check return code from `mount -na`, if there where any errors give
plugins a chance to do something about it.

Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-09-29 22:38:06 +02:00
Joachim Nilsson 9491f18972 service_enabled(): Only check WCOREDUMP() from if WIFSIGNALED()
Patch courtesy of Westermo.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-09-28 19:17:30 +02:00
Joachim Nilsson 545f3105e2 Update ChangeLog and bump version for v2.0 release.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2.0
2015-09-20 12:27:41 +02:00
Joachim Nilsson eec166a9eb Add simple service script for SysV init compat.
This patch adds a simple `service <script> <stop|start|reload|restart>`
script for for SysV init compatibility.  Very common with users of the
Ubuntu upstart init as well.

Also, fixed `make uninstall` for plugins.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-09-19 22:04:26 +02:00
Joachim Nilsson 125fc661a3 Makefile: Allow clean and distclean targets when libite/libuev are disabled.
Even though libite and libuEv can be disabled, using the --with-libnnn
option to configure, we let make descend into those submodules for the
clean and distclean targets.  This way we can rely on make dev to work.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-09-18 09:14:49 +02:00
Joachim Nilsson 6531b2f20a Add --with-libuev=PATH to configure script to use external libuEv
This commit makes it possible to build Finit with an external libuEv.
Without this configure script option the libuev submodule is used.

With an external libuEv we make sure to set the SONAME to libuev.so.1
to prevent any future runtime ABI issues.

Fixes issue #4.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-09-17 12:59:20 +02:00
Joachim Nilsson 1f84edfb8c Add --with-libite=PATH to configure script to use external libite
This commit makes it possible to build Finit with an external libite.
Without this configure script option the libite submodule is used.

With an external libite we make sure to set the SONAME to libite.so.2
to prevent runtime ABI issues with older libite versions.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-09-17 11:59:46 +02:00
Joachim Nilsson c354d0e7e6 Upgrade libite to v1.1.0
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-09-17 11:19:19 +02:00
Joachim Nilsson 98eb7cfea1 Upgrade libuEv to v1.2.3
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-09-17 11:18:38 +02:00
Joachim Nilsson ec80ce1c9b Add distclean step after Coverity run.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-09-15 11:58:53 +02:00
Joachim Nilsson ef05983dc8 Fix Coverity CID #149216: Buffer not NUL terminated
We should of course always use `strlcpy()` instead of `strncpy()`.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-09-15 11:49:47 +02:00
Joachim Nilsson 1c04097dca Update ChangeLog with new features and some Markdown syntax fixes.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-09-15 09:32:12 +02:00
Joachim Nilsson 36aba8952f Bump version to v2.0-beta1 for upcoming release and rename CHANGELOG.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-09-15 09:25:05 +02:00
Joachim Nilsson 6e07dd8dec Add support for starting/stopping services on Netlink events
This commit adds support for event based services to Finit.  Along with
the previously added support for multiple instances of the same process,
the feature scope for Finit v2.0 has been reached!

As of now a service can be declared in /etc/finit.conf or /etc/finit.d/
like this:

    service :1 [2345] <!IFUP:eth0,GW> /sbin/dropbear -R -F -p 22 -- SSH daemon

Here the first instance `:1` of dropbear is declared to run in runlevels
2-5, but only if eth0 `IFUP:eth0` is up and a gateway `GW` is set.  When
the configuration changes, a new gateway is set, or somehow a new `IFUP`
event for eth0 is received, then dropbear is not SIGHUP'ed, but instead
stop-started `<!>`.  The latter trick applies to all services, even
those that do not define any events.

Currently inetd services are not supported for event based starting, but
it could easily be added.  Likely scenario is to deny incoming requests
on, e.g., eth0 if there is no gateway.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-09-15 09:13:33 +02:00
Joachim Nilsson ffa32c6674 README: Clearify how multiple events can be emitted by initctl.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-09-15 09:05:10 +02:00
Joachim Nilsson c30039facf Minor refactor and cleanup.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-09-14 01:23:17 +02:00
Joachim Nilsson b13c6421b3 First Netlink plugin prototype.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-09-11 13:10:20 +02:00
Joachim Nilsson fcaf5d7b76 README.md: Commit to spec for v2.0 release.
The event API, including Netlink events to services, looks OK now
to build the remaining two features on:

- Netlink plugin for GW and IFUP IFDN events
- Generic event support for services

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-09-11 09:51:10 +02:00
Joachim Nilsson f9ddb1bdfc Make sure to always run HOOK_SVC_RECONF when services have been stopped.
Previously `HOOK_SVC_RECONF` was only called on `initctl reload`,
now we also call it on `initctl emit "STOP"`.  This seems like a
good idea atm, hopefully it will remain a good idea.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-09-11 08:58:39 +02:00
Joachim Nilsson 5701a00558 Update with idea on generic event support.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-09-08 08:19:16 +02:00
Joachim Nilsson 9a81bbccbb Update section on new emit <EVENT> support.
This part of the README must be completely overhauled before the
release, so much of the contents is basically just TODO or design
ideas atm.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-09-08 08:18:49 +02:00
Joachim Nilsson 2fcd0fd899 Merge branch 'wishdev-makefile-glibc-2.20' into dev 2015-09-08 08:01:12 +02:00
Joachim Nilsson 5126017c7e Merge branch 'makefile-glibc-2.20' of https://github.com/wishdev/finit into wishdev-makefile-glibc-2.20 2015-09-08 08:00:39 +02:00
John W Higgins d2ed03e74c Update Makefile for glibc-2.20+ 2015-09-07 16:56:32 -07:00
Joachim Nilsson 525aef10dd Add 'initctl show' as alias for 'initctl status', for convenience.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-09-06 20:45:56 +02:00
Joachim Nilsson 57031071fb Fix missing "libite/lite.h" include.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-09-06 20:43:28 +02:00
Joachim Nilsson 0bd57a7826 Fix missing overwrite argument to setenv().
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-09-02 16:05:42 +02:00
Joachim Nilsson 814ffd9259 Fix missing default PATH for root and non-root users.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-09-02 14:50:46 +02:00
Joachim Nilsson f94db7bceb Remove local macros for bitmanip, now provided by libite
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-08-22 14:00:12 +02:00
Joachim Nilsson 98ba5955c8 README: Document initial ideas for future event support
Writing TODO's in the README makes it a promise ...

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-08-22 13:56:36 +02:00
Joachim Nilsson 52c51f16ed Move to use dockerized/faster build at Travis-CI
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-08-22 13:55:07 +02:00
Joachim Nilsson 3b1e652d40 libite: Upgrade libite to v1.0.0+, lots of fixes
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-08-22 13:53:50 +02:00
Joachim Nilsson d6490df9a3 inetd.c: Improve error detection in inet port conversion.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-07-10 19:10:28 +02:00
Joachim Nilsson 0fd9aa6497 The atonum() function is now provied by libite.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-07-10 19:06:51 +02:00
Joachim Nilsson b30678bbe9 Functions makepath() and ifconfig() now provied by libite.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-07-10 18:33:47 +02:00