<arg>-swap</arg>
<arg>-persist</arg>
<arg>-nofork</arg>
+ <arg>-systemd-mark</arg>
<arg>-block-size <replaceable>block size</replaceable></arg>
<arg>-timeout <replaceable>seconds</replaceable></arg>
<arg>-name <replaceable>name</replaceable></arg>
</listitem>
</varlistentry>
<varlistentry>
+ <term><option>-systemd-mark</option></term>
+ <term><option>-m</option></term>
+ <listitem>
+ <para>The systemd init system requires that processes which
+ should not be killed at shutdown time be marked appropriately
+ by replacing the first letter of their argv[0] with an '@'
+ sign.</para>
+ <para>This option will cause nbd-client to do so.</para>
+ <para>Note that this only works if nbd-client is run from an
+ initrd; i.e., systemd will ignore such a mark if run from a
+ systemd unit file or from the command line.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
<term><option>-nofork</option></term>
<term><option>-n</option></term>
<listitem>
} else {
fprintf(stderr, "nbd-client version %s\n", PACKAGE_VERSION);
}
- fprintf(stderr, "Usage: nbd-client host port nbd_device [-block-size|-b block size] [-timeout|-t timeout] [-swap|-s] [-sdp|-S] [-persist|-p] [-nofork|-n]\n");
+ fprintf(stderr, "Usage: nbd-client host port nbd_device [-block-size|-b block size] [-timeout|-t timeout] [-swap|-s] [-sdp|-S] [-persist|-p] [-nofork|-n] [-systemd-mark|-m]\n");
fprintf(stderr, "Or : nbd-client -name|-N name host [port] nbd_device [-block-size|-b block size] [-timeout|-t timeout] [-swap|-s] [-sdp|-S] [-persist|-p] [-nofork|-n]\n");
fprintf(stderr, "Or : nbd-client -d nbd_device\n");
fprintf(stderr, "Or : nbd-client -c nbd_device\n");
{ "persist", no_argument, NULL, 'p' },
{ "sdp", no_argument, NULL, 'S' },
{ "swap", no_argument, NULL, 's' },
+ { "systemd-mark", no_argument, NULL, 'm' },
{ "timeout", required_argument, NULL, 't' },
{ 0, 0, 0, 0 },
};
nbddev="";
port = NBD_DEFAULT_PORT;
break;
+ case 'm':
+ argv[0][0] = '@';
+ break;
case 'n':
nofork=1;
break;