Commit Graph
676 Commits
Author SHA1 Message Date
Joachim Nilsson eb86a76a0d Travis-CI: Remove extra call to configure
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-03-19 22:51:34 +01:00
Joachim Nilsson 4423a2b16e Fix Travis-CI build, move package install
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-03-18 21:32:23 +01:00
Joachim Nilsson 0467c571df Merge pull request #22 from westermo/wmo/2.4
initctl: Only show service name, not path, with plain show
2016-03-17 22:04:27 +01:00
Joachim Nilsson cef4b5761a initctl: Only show service name, not path, with plain show
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-03-16 13:06:47 +01:00
Joachim Nilsson 806d05622a Fix libite.la library dependency in build
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-03-15 08:20:48 +01:00
Joachim Nilsson 57fb4738f1 Create empty m4 directory for the benefit of autogen.sh and Travis-CI
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-03-15 07:34:20 +01:00
Joachim Nilsson 0bbc69200b Update Travis-CI to use ./autogen.sh before configure & build
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-03-15 00:13:07 +01:00
Joachim Nilsson 726f0d428d Initial conversion to GNU Configure & Build System
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-03-14 22:35:54 +01:00
Joachim Nilsson 0704947c33 Merge pull request #20 from westermo/wmo/2.4
inetd reload fixes

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-02-19 15:11:20 +01:00
Tobias Waldekranz 2555fe8e96 inetd: Flush existing filters on reload
Flush any existing filter rules when a configuration file is
updated. Otherwise filters are simply appended to the old
configuration which can cause finit to accept connections on
interfaces that are blocked in the new configuration.
2016-02-19 12:53:39 +01:00
Tobias Waldekranz c41016ef32 Only default to SIGHUP support on daemons
When parsing a service configuration, only default to SIGHUP support
if the service is a daemon. inetd services must be stop/started on
change.
2016-02-19 12:50:24 +01:00
Joachim Nilsson 5d86137142 Fix Coverity warning for unchecked return value from mkdir()
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-02-05 23:13:47 +01:00
Joachim Nilsson bd58345b8c Fix Coverity warning for unterminated string from read()
The read() does not zero terminate the string, then we call strstr() on
that string ...

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-02-05 23:01:24 +01:00
Joachim Nilsson 994b589377 Fix Coverity warning for possible NULL ptr dereference
Add check for return value from strtok()

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-02-05 22:55:39 +01:00
Joachim Nilsson caff08f58d Fix Coverity warning for unchecked return value from dirname()
- Check return value from dirname()
- Remove static from local compose buffer

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-02-05 22:50:08 +01:00
Joachim Nilsson d58c58d972 Test build with both GCC and Clang (LLVM)
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-02-05 21:57:58 +01:00
Joachim Nilsson a97499999e Remove initial make distclean step, not needed
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-02-05 21:54:34 +01:00
Joachim Nilsson 9c7046a25d Fix linking error with new autotools based libraries
We may have reached peak Makefile mastery now ...

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-02-05 21:44:21 +01:00
Joachim Nilsson cd5d55ef51 Call libuev configure script if local libuev is used
Same as for libite, libuev has also changed to autotools, so
call its autogen.sh and configure script in cascade from our
own.  Aslo add safeguards to clean/distclean targets so we
do not attempt to enter the libuev subdirectory if it's not
configured.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-02-05 21:43:04 +01:00
Joachim Nilsson 5eb172ed46 Update to libuEv v1.3.1
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-02-05 21:23:16 +01:00
Joachim Nilsson 3d99940252 Bump version to 3.0-beta1
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-02-05 21:10:47 +01:00
Joachim Nilsson fce420121c Fix unused variable warning
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-02-05 21:10:25 +01:00
Joachim Nilsson 6c91c4ec12 Fix unused variable warning
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-02-05 21:09:31 +01:00
Joachim Nilsson 2cb5997abe Fix signed/unsigned comparison warning
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-02-05 21:09:20 +01:00
Joachim Nilsson 5afb47bc9b ChangeLog: Add missing links to referenced previous versions
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-02-05 21:08:21 +01:00
Joachim Nilsson d6d92f1df7 Increase indentation in pretty printing slightly for autotools
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-02-05 21:07:17 +01:00
Joachim Nilsson 4899bba06b Call libite configure script if local libite is used
The new libite uses autotools to build, and since we use it as a GIT
submodule we have to call its autogen.sh before we call the configure
script, from within the Finit configure script.  We may have to move
to use autotools even for Finit ...

Also, make sure to only call clean/distclean on libite if the local
version is selected at configure time.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-02-05 21:06:46 +01:00
Joachim Nilsson 97a160dd1d Update to libite v1.4.3
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-02-05 20:26:40 +01:00
Joachim Nilsson 901bdc68ba Merge pull request #19 from westermo/wmo/2.4
Service state machine and refactored event/condition handling

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-02-05 16:44:51 +01:00
Tobias Waldekranz c6055031b8 Avoid unnecessary restarts of services that do not support SIGHUP
When a service's condition transitions to `flux`, put it in the
waiting state, even if it does not support SIGHUP. That way, if the
condition returns to `on` we can simply SIGCONT it. If it goes to
`off` it will still be stop/started as before.
2016-02-05 13:45:06 +01:00
Tobias Waldekranz e8d699c194 Mark inetd services as clean on dynamic reload
When reloading dynamic services, inetd services deleted marker was not
being cleaned. This caused finit to stop and start all inetd services
at every other reload.
2016-01-28 14:52:49 +01:00
Tobias Waldekranz 80273555c5 Do all service transitions in a helper function
This eases development, since it makes it easy to set a breakpoint on
a specific state transition.
2016-01-28 13:44:27 +01:00
Tobias Waldekranz 6ece4b8fa3 inetd: Re-integrate the inetd subsystem into the new service model
This patch introduces a new service type called SVC_TYPE_INETD_CONN,
which represents a running inetd connection. These are handled in much
the same way as tasks. I.e. they are considered one-time jobs, with
the difference that they are removed upon completion.
2016-01-15 10:07:15 +01:00
Tobias Waldekranz 0beb566e45 git: Ignore Emacs backup files 2016-01-13 16:02:46 +01:00
Tobias Waldekranz c641a1374e Do not ignore updated services when cleaning up removed ones
When cleaning up removed services, the assumption was made that if a
service was not 'removed', it was 'clean'. In reality, it could also
be 'updated', which was then overwritten, causing services not being
restarted. Don't do that.

As a future precaution, make the dirty field const, only allowing
updates from accessor methods.
2016-01-13 15:14:27 +01:00
Tobias Waldekranz 171d611b14 Improve service state machine debug messages
In addition to logging state transitions, also log the parameters that
might trigger a transition.
2016-01-13 15:09:04 +01:00
Tobias Waldekranz 02eb68f46c Ensure that a service has stopped before taking any further action
During documentation of the state machine, some theoretical problems
where discovered that could have lead finit to spawn a new instance of
a daemon before the previous one had been collected.

Now a service will always go through the STOPPING state when leaving
RUNNING. This ensures that the PID has been collected before any calls
to service_start.

...documenting your work is, apparently, not a bad idea. :)
2016-01-07 11:00:52 +01:00
Tobias Waldekranz 7fe4c3355f doc: Add service state machine documentation 2016-01-07 11:00:51 +01:00
Joachim Nilsson 5b28fed321 Audit.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-01-05 21:11:27 +01:00
Tobias Waldekranz aa1da0e9f2 doc: Add documentation for conditions 2016-01-05 17:24:31 +01:00
Tobias Waldekranz 2232aea0f7 Dynamically manage service states based on user defined conditions
Old event system has been replaced with a more generic condition
concept. The idea is that finit plugins may provide arbitrary
conditions that services may specify as dependencies that they require
to run.

In order to accomodate this, the service management has been
redesigned to use a state machine.
2016-01-05 15:01:58 +01:00
Tobias Waldekranz 7a3408c173 Optionally skip stripping binaries during install-exec
One may wish to build and install with debug symbols intact, so allow
overriding the arguments sent to install.
2016-01-05 14:50:13 +01:00
Tobias Waldekranz af7b6c17cb Correctly parse service configuration stanzas containing slashes
Parser would erroneously interpret an event specification containing
slashes as an inet service/proto specification.

E.g. "<net/gw>" was interpreted as port "<net" using protocol "gw>".
2016-01-05 14:50:13 +01:00
Joachim Nilsson a822a7657c Update ChangeLog and bump version for v2.4 release
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2.4
2015-12-04 19:15:48 +01:00
Joachim Nilsson e46271c1a9 Revert change in v2.3 listing stopped services as "paused"
Stopped services are now (again) listed as "stopped" and halted
services, due to a runlevel change, are listed as "halted". Several
users complained that this change was just not intuitive. I agreee.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-12-04 19:05:35 +01:00
Joachim Nilsson 1028725079 Add support for 'initctl show dropbear:2'
By popular request, this patch adds support for querying status of a
single service.  The syntax is similar to that of stop/start/reload.

Both `initctl show ...` and `initctl status ...` is supported.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-12-03 20:05:25 +01:00
Joachim Nilsson ed5ee667ae [Patch 2/2]: Make sure to start/SIGHUP services when none were stopped
When no services were stopped we must ensure to start/SIGHUP any new or
SIGHUP:able services as the last pass of the `initctl reload` cycle.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-12-02 13:06:16 +01:00
Joachim Nilsson 4c3e053041 [Patch 1/2]: System reconfiguration causing system freeze
This patch fixes a hang when performing a system reconfiguration using
`initctl reload`, `SIGHUP` or running `(f)init q`, which caused Finit
to wait for SIGHUP:able services to stop.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-12-02 13:02:40 +01:00
Joachim Nilsson a5c5a5c644 Allow debug mode to override terse mode
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-12-01 22:36:16 +01:00
Joachim Nilsson fa3a97366c Update Debugging section, all interesting stuff is in configure now
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-12-01 22:30:08 +01:00