From ab40ddf5c704b9554fad990f73be95fa5fe58df3 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Mon, 11 Oct 2021 07:55:08 +0000 Subject: Add D, T, X and x support to sv Signed-off-by: Laurent Bercot --- src/alias/s6-frontend-alias-sv.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/alias/s6-frontend-alias-sv.c b/src/alias/s6-frontend-alias-sv.c index 3b1d3ac..e38ab28 100644 --- a/src/alias/s6-frontend-alias-sv.c +++ b/src/alias/s6-frontend-alias-sv.c @@ -153,6 +153,12 @@ static int down (char const *dir, char const *const *envp) return action(dir, "-d", "-d", 'D', envp) ; } +static int forcedown (char const *dir, char const *const *envp) +{ + warnnokill() ; + return down(dir, envp) ; +} + static int bail (char const *dir, char const *const *envp) { int e ; @@ -162,6 +168,12 @@ static int bail (char const *dir, char const *const *envp) return e ; } +static int forcebail (char const *dir, char const *const *envp) +{ + warnnokill() ; + return bail(dir, envp) ; +} + static int hup_h (char const *dir, char const *const *envp) { return simple_svc(dir, "-h", envp) ; @@ -282,10 +294,19 @@ static int lsb_tryrestart (char const *dir, char const *const *envp) return e | status(dir, envp) ; } +static int lsb_forcetryrestart (char const *dir, char const *const *envp) +{ + warnnokill() ; + return lsb_tryrestart(dir, envp) ; +} + static info_t const commands[] = { { .name = "1", .f = &usr1_h }, { .name = "2", .f = &usr2_h }, + { .name = "D", .f = &forcedown }, + { .name = "T", .f = &lsb_forcetryrestart }, + { .name = "X", .f = &forcebail }, { .name = "a", .f = &alarm_h }, { .name = "al", .f = &alarm_h }, { .name = "ala", .f = &alarm_h }, @@ -354,7 +375,8 @@ static info_t const commands[] = { .name = "term", .f = &term_h }, { .name = "try-restart", .f = &lsb_tryrestart }, { .name = "u", .f = &up }, - { .name = "up", .f = &up } + { .name = "up", .f = &up }, + { .name = "x", .f = &bail } } ; int main (int argc, char const *const *argv, char const *const *envp) -- cgit 1.4.1