summaryrefslogtreecommitdiff
path: root/runit
diff options
context:
space:
mode:
authorDenys Vlasenko2015-10-19 00:41:28 +0200
committerDenys Vlasenko2015-10-19 00:41:28 +0200
commit0863e1a576c4b26bb87564b3a403f1094814f1aa (patch)
tree5670b59149bfff4ad86acf008ac66abf0f7557da /runit
parent000eda41c084bae95d9e40a570cbdaa5ffd3d22e (diff)
downloadbusybox-0863e1a576c4b26bb87564b3a403f1094814f1aa.zip
busybox-0863e1a576c4b26bb87564b3a403f1094814f1aa.tar.gz
runit/*: convert to new-style "one file" applets
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'runit')
-rw-r--r--runit/Config.src79
-rw-r--r--runit/Kbuild.src11
-rw-r--r--runit/chpst.c45
-rw-r--r--runit/runsv.c12
-rw-r--r--runit/runsvdir.c22
-rw-r--r--runit/sv.c20
-rw-r--r--runit/svlogd.c13
7 files changed, 107 insertions, 95 deletions
diff --git a/runit/Config.src b/runit/Config.src
index 9db9740..8cde896 100644
--- a/runit/Config.src
+++ b/runit/Config.src
@@ -7,83 +7,4 @@ menu "Runit Utilities"
INSERT
-config RUNSV
- bool "runsv"
- default y
- help
- runsv starts and monitors a service and optionally an appendant log
- service.
-
-config RUNSVDIR
- bool "runsvdir"
- default y
- help
- runsvdir starts a runsv process for each subdirectory, or symlink to
- a directory, in the services directory dir, up to a limit of 1000
- subdirectories, and restarts a runsv process if it terminates.
-
-config FEATURE_RUNSVDIR_LOG
- bool "Enable scrolling argument log"
- depends on RUNSVDIR
- default n
- help
- Enable feature where second parameter of runsvdir holds last error
- message (viewable via top/ps). Otherwise (feature is off
- or no parameter), error messages go to stderr only.
-
-config SV
- bool "sv"
- default y
- help
- sv reports the current status and controls the state of services
- monitored by the runsv supervisor.
-
-config SV_DEFAULT_SERVICE_DIR
- string "Default directory for services"
- default "/var/service"
- depends on SV
- help
- Default directory for services.
- Defaults to "/var/service"
-
-config SVLOGD
- bool "svlogd"
- default y
- help
- svlogd continuously reads log data from its standard input, optionally
- filters log messages, and writes the data to one or more automatically
- rotated logs.
-
-config CHPST
- bool "chpst"
- default y
- help
- chpst changes the process state according to the given options, and
- execs specified program.
-
-config SETUIDGID
- bool "setuidgid"
- default y
- help
- Sets soft resource limits as specified by options
-
-config ENVUIDGID
- bool "envuidgid"
- default y
- help
- Sets $UID to account's uid and $GID to account's gid
-
-config ENVDIR
- bool "envdir"
- default y
- help
- Sets various environment variables as specified by files
- in the given directory
-
-config SOFTLIMIT
- bool "softlimit"
- default y
- help
- Sets soft resource limits as specified by options
-
endmenu
diff --git a/runit/Kbuild.src b/runit/Kbuild.src
index 0fce955..6b4fb74 100644
--- a/runit/Kbuild.src
+++ b/runit/Kbuild.src
@@ -7,14 +7,3 @@
lib-y:=
INSERT
-
-lib-$(CONFIG_RUNSV) += runsv.o
-lib-$(CONFIG_RUNSVDIR) += runsvdir.o
-lib-$(CONFIG_SV) += sv.o
-lib-$(CONFIG_SVLOGD) += svlogd.o
-lib-$(CONFIG_CHPST) += chpst.o
-
-lib-$(CONFIG_ENVDIR) += chpst.o
-lib-$(CONFIG_ENVUIDGID) += chpst.o
-lib-$(CONFIG_SETUIDGID) += chpst.o
-lib-$(CONFIG_SOFTLIMIT) += chpst.o
diff --git a/runit/chpst.c b/runit/chpst.c
index 71af29f..301cdd0 100644
--- a/runit/chpst.c
+++ b/runit/chpst.c
@@ -26,7 +26,50 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/* Busyboxed by Denys Vlasenko <vda.linux@googlemail.com> */
-/* Dependencies on runit_lib.c removed */
+
+//config:config CHPST
+//config: bool "chpst"
+//config: default y
+//config: help
+//config: chpst changes the process state according to the given options, and
+//config: execs specified program.
+//config:
+//config:config SETUIDGID
+//config: bool "setuidgid"
+//config: default y
+//config: help
+//config: Sets soft resource limits as specified by options
+//config:
+//config:config ENVUIDGID
+//config: bool "envuidgid"
+//config: default y
+//config: help
+//config: Sets $UID to account's uid and $GID to account's gid
+//config:
+//config:config ENVDIR
+//config: bool "envdir"
+//config: default y
+//config: help
+//config: Sets various environment variables as specified by files
+//config: in the given directory
+//config:
+//config:config SOFTLIMIT
+//config: bool "softlimit"
+//config: default y
+//config: help
+//config: Sets soft resource limits as specified by options
+
+//applet:IF_CHPST(APPLET(chpst, BB_DIR_USR_BIN, BB_SUID_DROP))
+//applet:IF_ENVDIR(APPLET_ODDNAME(envdir, chpst, BB_DIR_USR_BIN, BB_SUID_DROP, envdir))
+//applet:IF_ENVUIDGID(APPLET_ODDNAME(envuidgid, chpst, BB_DIR_USR_BIN, BB_SUID_DROP, envuidgid))
+//applet:IF_SETUIDGID(APPLET_ODDNAME(setuidgid, chpst, BB_DIR_USR_BIN, BB_SUID_DROP, setuidgid))
+//applet:IF_SOFTLIMIT(APPLET_ODDNAME(softlimit, chpst, BB_DIR_USR_BIN, BB_SUID_DROP, softlimit))
+
+//kbuild:lib-$(CONFIG_CHPST) += chpst.o
+//kbuild:lib-$(CONFIG_ENVDIR) += chpst.o
+//kbuild:lib-$(CONFIG_ENVUIDGID) += chpst.o
+//kbuild:lib-$(CONFIG_SETUIDGID) += chpst.o
+//kbuild:lib-$(CONFIG_SOFTLIMIT) += chpst.o
//usage:#define chpst_trivial_usage
//usage: "[-vP012] [-u USER[:GRP]] [-U USER[:GRP]] [-e DIR]\n"
diff --git a/runit/runsv.c b/runit/runsv.c
index 6cf5bcc..4b18d12 100644
--- a/runit/runsv.c
+++ b/runit/runsv.c
@@ -26,7 +26,17 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/* Busyboxed by Denys Vlasenko <vda.linux@googlemail.com> */
-/* TODO: depends on runit_lib.c - review and reduce/eliminate */
+
+//config:config RUNSV
+//config: bool "runsv"
+//config: default y
+//config: help
+//config: runsv starts and monitors a service and optionally an appendant log
+//config: service.
+
+//applet:IF_RUNSV(APPLET(runsv, BB_DIR_USR_BIN, BB_SUID_DROP))
+
+//kbuild:lib-$(CONFIG_RUNSV) += runsv.o
//usage:#define runsv_trivial_usage
//usage: "DIR"
diff --git a/runit/runsvdir.c b/runit/runsvdir.c
index b4c0b2e..b3d9e73 100644
--- a/runit/runsvdir.c
+++ b/runit/runsvdir.c
@@ -26,7 +26,27 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/* Busyboxed by Denys Vlasenko <vda.linux@googlemail.com> */
-/* TODO: depends on runit_lib.c - review and reduce/eliminate */
+
+//config:config RUNSVDIR
+//config: bool "runsvdir"
+//config: default y
+//config: help
+//config: runsvdir starts a runsv process for each subdirectory, or symlink to
+//config: a directory, in the services directory dir, up to a limit of 1000
+//config: subdirectories, and restarts a runsv process if it terminates.
+//config:
+//config:config FEATURE_RUNSVDIR_LOG
+//config: bool "Enable scrolling argument log"
+//config: depends on RUNSVDIR
+//config: default n
+//config: help
+//config: Enable feature where second parameter of runsvdir holds last error
+//config: message (viewable via top/ps). Otherwise (feature is off
+//config: or no parameter), error messages go to stderr only.
+
+//applet:IF_RUNSVDIR(APPLET(runsvdir, BB_DIR_USR_BIN, BB_SUID_DROP))
+
+//kbuild:lib-$(CONFIG_RUNSVDIR) += runsvdir.o
//usage:#define runsvdir_trivial_usage
//usage: "[-P] [-s SCRIPT] DIR"
diff --git a/runit/sv.c b/runit/sv.c
index 825e9d4..de8a0d8 100644
--- a/runit/sv.c
+++ b/runit/sv.c
@@ -151,7 +151,25 @@ Exit Codes
*/
/* Busyboxed by Denys Vlasenko <vda.linux@googlemail.com> */
-/* TODO: depends on runit_lib.c - review and reduce/eliminate */
+
+//config:config SV
+//config: bool "sv"
+//config: default y
+//config: help
+//config: sv reports the current status and controls the state of services
+//config: monitored by the runsv supervisor.
+//config:
+//config:config SV_DEFAULT_SERVICE_DIR
+//config: string "Default directory for services"
+//config: default "/var/service"
+//config: depends on SV
+//config: help
+//config: Default directory for services.
+//config: Defaults to "/var/service"
+
+//applet:IF_SV(APPLET(sv, BB_DIR_USR_BIN, BB_SUID_DROP))
+
+//kbuild:lib-$(CONFIG_SV) += sv.o
//usage:#define sv_trivial_usage
//usage: "[-v] [-w SEC] CMD SERVICE_DIR..."
diff --git a/runit/svlogd.c b/runit/svlogd.c
index c080b9a..dbe8df6 100644
--- a/runit/svlogd.c
+++ b/runit/svlogd.c
@@ -26,7 +26,6 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/* Busyboxed by Denys Vlasenko <vda.linux@googlemail.com> */
-/* TODO: depends on runit_lib.c - review and reduce/eliminate */
/*
Config files
@@ -125,6 +124,18 @@ log message, you can use a pattern like this instead
-*: *: pid *
*/
+//config:config SVLOGD
+//config: bool "svlogd"
+//config: default y
+//config: help
+//config: svlogd continuously reads log data from its standard input, optionally
+//config: filters log messages, and writes the data to one or more automatically
+//config: rotated logs.
+
+//applet:IF_SVLOGD(APPLET(svlogd, BB_DIR_USR_SBIN, BB_SUID_DROP))
+
+//kbuild:lib-$(CONFIG_SVLOGD) += svlogd.o
+
//usage:#define svlogd_trivial_usage
//usage: "[-ttv] [-r C] [-R CHARS] [-l MATCHLEN] [-b BUFLEN] DIR..."
//usage:#define svlogd_full_usage "\n\n"