diff options
author | Lee Duncan <lduncan@suse.com> | 2019-05-14 11:18:40 -0700 |
---|---|---|
committer | Lee Duncan <lduncan@suse.com> | 2019-05-14 11:18:40 -0700 |
commit | c1870ae6dddb7bc2dbdc750df68edbbe1a80763f (patch) | |
tree | e2bb1d656a9864e3945a025e8b0a7a7cab226afa /iscsiuio | |
parent | 1aa16e914eec3c97210a93dfab25b194e56a8298 (diff) | |
download | open-iscsi-c1870ae6dddb7bc2dbdc750df68edbbe1a80763f.tar.gz |
Add systemd support for iscsiuio
Add in example socket and service files for iscsiuio, such
that it can socket-activated, as is iscsid. Also, update
main in iscsiuio to use sd_notify() when it is ready for
business. All of the systemd code can be skipped if
NO_SYSTEMD is defined when building.
Diffstat (limited to 'iscsiuio')
-rw-r--r-- | iscsiuio/src/unix/main.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/iscsiuio/src/unix/main.c b/iscsiuio/src/unix/main.c index dd7df4d..5168e4e 100644 --- a/iscsiuio/src/unix/main.c +++ b/iscsiuio/src/unix/main.c @@ -48,6 +48,9 @@ #include <net/ethernet.h> #include <arpa/inet.h> #include <sys/mman.h> +#ifndef NO_SYSTEMD +#include <systemd/sd-daemon.h> +#endif #include "uip.h" #include "uip_arp.h" @@ -416,6 +419,11 @@ int main(int argc, char *argv[]) close(pipefds[1]); } +#ifndef NO_SYSTEMD + sd_notify(0, "READY=1\n" + "STATUS=Ready to process requests\n"); +#endif + /* NetLink connection to listen to NETLINK_ISCSI private messages */ if (nic_nl_open() != 0) goto error; |