All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Grover <agrover@redhat.com>
To: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>, stgt@vger.kernel.org
Cc: Apollon Oikonomopoulos <apoikos@debian.org>
Subject: Re: [PATCH] systemd notification support
Date: Wed, 21 May 2014 14:00:58 -0700	[thread overview]
Message-ID: <537D140A.3000705@redhat.com> (raw)
In-Reply-To: <1400640207-2743-1-git-send-email-fujita.tomonori@lab.ntt.co.jp>

[-- Attachment #1: Type: text/plain, Size: 1173 bytes --]

On 05/20/2014 07:43 PM, FUJITA Tomonori wrote:
> From: Apollon Oikonomopoulos <apoikos@debian.org>
>
> tgtd may take some time to initialize before accepting management
> commands. Since management commands are used to bring the targets up
> during service startup, we have to make sure that tgtd is responsive
> before proceeding. To this end, we add a call to sd_notify(3) right
> before entering the event loop to signal systemd (if applicable) that
> the main process is ready.
>
> Systemd support with the relevant includes and linker flags is optional,
> controlled by the SD_NOTIFY make flag.
>
> Signed-off-by: Apollon Oikonomopoulos <apoikos@debian.org>

Hi Apollon,

Fedora tgtd pkg maintainer here.

Better systemd integration seems like a good way to go. BTW I feel deep 
shame about the systemd service file that Fedora is currently using 
(attached), especially the sleep. Does this or another change perhaps 
result in a better way to integrate tgt with systemd?

Do we need two service files or something?

It would be great if tgt could use the same service file(s) on all 
systemd-enabled distros, and these could be included with tgtd.

Regards -- Andy


[-- Attachment #2: tgtd.service --]
[-- Type: text/plain, Size: 1229 bytes --]

[Unit]
Description=tgtd iSCSI target daemon
After=network.target

[Service]
EnvironmentFile=/etc/sysconfig/tgtd

ExecStart=/usr/sbin/tgtd -f $TGTD_OPTS
# see bz 848942. workaround for a race for now.
ExecStartPost=/bin/sleep 5
# Put tgtd into "offline" state until all the targets are configured.
# We don't want initiators to (re)connect and fail the connection
# if it's not ready.
ExecStartPost=/usr/sbin/tgtadm --op update --mode sys --name State -v offline
# Configure the targets.
ExecStartPost=/usr/sbin/tgt-admin -e -c $TGTD_CONFIG
# Put tgtd into "ready" state.
ExecStartPost=/usr/sbin/tgtadm --op update --mode sys --name State -v ready

# Update configuration for targets. Only targets which
# are not in use will be updated.
ExecReload=/usr/sbin/tgt-admin --update ALL -c $TGTD_CONFIG

# NOTE: Shutdown of the iscsi target may cause data corruption
# for initiators that are connected.
ExecStop=/usr/sbin/tgtadm --op update --mode sys --name State -v offline
# Remove all targets. It only removes targets which are not in use.
ExecStop=/usr/sbin/tgt-admin --update ALL -c /dev/null
# tgtd will exit if all targets were removed
ExecStop=/usr/sbin/tgtadm --op delete --mode system

[Install]
WantedBy=multi-user.target

  reply	other threads:[~2014-05-21 21:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-21  2:43 [PATCH] systemd notification support FUJITA Tomonori
2014-05-21 21:00 ` Andy Grover [this message]
2014-05-21 22:00   ` Apollon Oikonomopoulos
2014-05-25 11:18     ` FUJITA Tomonori
2014-05-25 11:18 ` FUJITA Tomonori

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=537D140A.3000705@redhat.com \
    --to=agrover@redhat.com \
    --cc=apoikos@debian.org \
    --cc=fujita.tomonori@lab.ntt.co.jp \
    --cc=stgt@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.