Commit Graph
17 Commits
Author SHA1 Message Date
Joachim Nilsson 79b95daf3a The pidfile plugin requires /var/run, so depend on bootmisc
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-06-06 19:44:21 +02:00
Joachim Nilsson cc15d3f77b Merge branch 'finit-sm' of https://github.com/westermo/finit into westermo-finit-sm
Hand merged conflicts in the following files:
	Makefile
	finit.h
	service.c

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-06-04 19:48:08 +02:00
Jonas Johansson c1f725340d plugin/pidfile: also notify on modified pidfiles
Signed-off-by: Jonas Johansson <jonas.johansson@westermo.se>
2016-05-19 13:39:56 +02:00
Joachim Nilsson 4b0f78c1b5 Merge pull request #27 from westermo/wmo/2.4
Westermo fixes for UDP inetd services and more

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-04-24 12:06:43 +02:00
Joachim Nilsson 439d9df122 Set CLOEXEC flag to prevent leaking descriptors
Both the new initctl API and the new pidfile watcher plugin failed to
set CLOEXEC on their sockets.  This caused forked-off and exec()'d
children to inherit all these descriptors.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-04-24 10:52:39 +02:00
Joachim Nilsson 4efdc4fe19 Merge pull request #25 from westermo/wmo/2.4
Westermo fixes to Finit3
2016-04-10 20:08:25 +02:00
Joachim Nilsson da76cf4f75 Check return value from strtok(), may be NULL
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-04-10 19:58:46 +02:00
Joachim Nilsson a2177a8063 Fix GCC warning for signed vs unsigned comparison
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-04-10 19:58:13 +02:00
Joachim Nilsson cfa155deae Minor cleanup
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-04-10 19:57:48 +02:00
Joachim Nilsson d7d45b65d0 Merge pull request #24 from westermo/wmo/2.4
Assert svc condition only when PID file has been created/updated

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-04-10 19:50:16 +02:00
Joachim Nilsson 4ae5c54f45 Assert svc condition only when PID file has been created/updated
This patch prevents too early start of services depending on other
services.  E.g, if service B depends on A then we must wait for A to
signal that it is ready before we allow B to start -- in a Finit based
system A does this by creating, or touching (updating mtime), its PID
file.  Services (like A) that support SIGHUP should call utime(), or
utimensat(), on the PID file at the end of their SIGHUP handler.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-04-10 19:14:48 +02:00
Joachim Nilsson 6a49f7ed8c Add missing license, copyright and module description
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-03-21 15:56:15 +01:00
Joachim Nilsson 8bcc34ce91 Remove Emacs version-control handling
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-03-21 15:41:51 +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 2cb5997abe Fix signed/unsigned comparison warning
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-02-05 21:09:20 +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