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
Joachim Nilsson
1db144c677
Functions pidfile_read() and pidfile_poll() now provied by libite.
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2015-07-09 03:24:20 +02:00
Joachim Nilsson
8b8ddc43b5
Refactor: Further API cleanup -- hide svc_t internals.
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2015-06-29 01:50:21 +02:00
Joachim Nilsson
838ec0423d
Fix: Loss of dynamic service on second reload (unmodified).
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2015-06-29 01:25:45 +02:00
Joachim Nilsson
05a8ace030
Add support for 'initctl emit EVENT' for more granular control.
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2015-06-29 00:58:12 +02:00
Joachim Nilsson
a05f920292
Refactor: Cleanup internal API
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2015-06-28 17:23:07 +02:00
Joachim Nilsson
d8b331d737
Update .gitignore
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2015-06-28 17:20:56 +02:00
Joachim Nilsson
381a32bf8a
Upgrade libite to fix copyfile() bug.
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2015-06-22 22:43:04 +02:00
Joachim Nilsson
ee9e49f412
Makefile: Do not fail anymore on warnings, not useful in production.
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2015-06-22 22:04:14 +02:00
Joachim Nilsson
ff2df8ce5c
Upgrade libite, handle missing O_TMPFILE gracefully.
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2015-06-22 22:03:32 +02:00
Joachim Nilsson
e595e9da5f
Upgrde to libite version with new tempfile()
...
The tempfile() replacement in Finit leaked temporary files in /tmp.
The mkstemp() based implementation does not remove temporary files
when they are closed.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2015-06-22 21:44:46 +02:00
Joachim Nilsson
f1807a32ca
Make it possible to distribute finit.h in 'make dev-install'
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2015-06-22 15:12:20 +02:00
Joachim Nilsson
9a6ab331a6
Refactor: Move rest of finit.h settings to configure script.
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2015-06-22 15:12:20 +02:00
Joachim Nilsson
70af5d7f8d
Refactor: Move HAVE_DBUS and CONSOLE to configure script.
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2015-06-22 15:12:20 +02:00
Joachim Nilsson
36c59e77b4
Fix broken SYSROOT and add it to configure script.
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2015-06-22 15:12:20 +02:00
Joachim Nilsson
57b167f9aa
Refactor: Move root fs remount setting to configure script.
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2015-06-22 15:12:20 +02:00
Joachim Nilsson
155ae15390
Refactor: Move random seed config to configure script.
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2015-06-22 15:12:20 +02:00
Joachim Nilsson
06a1a3c839
Refactor: Move default runlevel to configure script.
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2015-06-22 15:12:20 +02:00
Joachim Nilsson
42f3d4dc79
Refactor: Move DEFUSER and DEFHOST to configure script
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2015-06-22 15:12:20 +02:00
Joachim Nilsson
8e12dba8d9
Refactor: Move conf.c declarations from finit.h --> conf.h
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2015-06-22 15:12:20 +02:00
Joachim Nilsson
589a7ea8a5
Always run HOOK_SVC_RECONF on SIGHUP/reload
...
When Finit receives SIGHUP or a reload command all services listed in
/etc/finit.d/*.conf are first stopped and then started again. I.e.,
removed/changed services are stopped and then new/changed services are
started again. In between we call HOOK_SVC_RECONF. It should always be
called, even though no services were removed/changed/added. This to
allow plugins connected to that hook may need to run as intended.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2015-06-22 15:12:20 +02:00
Joachim Nilsson
e5732f24d3
Followup to tempfile(): template must be writable.
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2015-06-22 15:12:20 +02:00
Joachim Nilsson
3d0e58ebcd
Followup to tempfile(): paranoid umask as well ...
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2015-06-21 22:25:33 +02:00
Joachim Nilsson
162b394726
Replace insecure tmpfile() with mkstemp() based local tempfile()
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2015-06-21 21:54:24 +02:00
Joachim Nilsson
c6a9fa3b98
initctl: Order inetd filters same as in .conf file.
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2015-06-21 19:06:07 +02:00