aboutsummaryrefslogtreecommitdiffstats
path: root/src/s6/service_stop.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2025-06-06 18:15:00 +0000
committerLaurent Bercot <ska@appnovation.com>2025-06-06 18:15:00 +0000
commit0db2f82a71f627be6b0feff3541862072653181e (patch)
tree8bd1c7d1e5def588ca83cd68664893403521326f /src/s6/service_stop.c
parent3f75ffee7c0c7d6b70cf305d60435ac862ea9ab5 (diff)
downloads6-frontend-0db2f82a71f627be6b0feff3541862072653181e.tar.gz
Add skeleton for "s6 service"
Signed-off-by: Laurent Bercot <ska@appnovation.com>
Diffstat (limited to 'src/s6/service_stop.c')
-rw-r--r--src/s6/service_stop.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/s6/service_stop.c b/src/s6/service_stop.c
new file mode 100644
index 0000000..fc1db58
--- /dev/null
+++ b/src/s6/service_stop.c
@@ -0,0 +1,32 @@
+/* ISC license. */
+
+#include <skalibs/uint64.h>
+#include <skalibs/strerr.h>
+#include <skalibs/gol.h>
+
+#include "s6-internal.h"
+
+#define USAGE "s6 service stop services..."
+#define dieusage() strerr_dieusage(100, USAGE)
+
+enum service_stop_golb_e
+{
+ SERVICE_STOP_GOLB_WAIT,
+ SERVICE_STOP_GOLB_N
+} ;
+
+static gol_bool const service_stop_golb[2] =
+{
+ { .so = 'W', .lo = "nowait", .set = 0, .mask = 1 << SERVICE_STOP_GOLB_WAIT },
+ { .so = 'w', .lo = "wait", .set = 1, .mask = 1 << SERVICE_STOP_GOLB_WAIT }
+} ;
+
+int service_stop (char const *const *argv)
+{
+ uint64_t golb = 0 ;
+ PROG = "s6 service stop" ;
+
+ argv += gol_argv(argv, service_stop_golb, 0, 0, 0, &golb, 0) ;
+ if (!argv) dieusage() ;
+ return 0 ;
+}