Bug 872339 - systemctl stop (any-swift-service) fails to stop swift service
Summary: systemctl stop (any-swift-service) fails to stop swift service
Keywords:
Status: CLOSED DUPLICATE of bug 807170
Alias: None
Product: Fedora
Classification: Fedora
Component: openstack-swift
Version: 18
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Silas Sewell
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-11-01 20:15 UTC by Matthias Runge
Modified: 2012-11-05 10:30 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-11-05 10:30:53 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Matthias Runge 2012-11-01 20:15:45 UTC
Description of problem:

I tried to stop all running (openstack services):
[root@turing openstack-dashboard]# for i in `systemctl --full --all | grep openstack | awk '{print $1}'`; do systemctl stop $i; done

[root@turing openstack-dashboard]# ps ax | grep swift
10560 ?        Ss     0:00 /usr/bin/python /usr/bin/swift-container-updater /etc/swift/container-server.conf
10583 ?        Ss     0:01 /usr/bin/python /usr/bin/swift-object-updater /etc/swift/object-server.conf
17214 pts/13   S+     0:00 grep --color=auto swift
27907 ?        Ss     0:51 /usr/bin/python /usr/bin/swift-account-replicator /etc/swift/account-server.conf
27913 ?        Ss     0:00 /usr/bin/python /usr/bin/swift-account-auditor /etc/swift/account-server.conf
27932 ?        Ss     0:17 /usr/bin/python /usr/bin/swift-container-replicator /etc/swift/container-server.conf
27948 ?        Ss     0:00 /usr/bin/python /usr/bin/swift-container-auditor /etc/swift/container-server.conf
27967 ?        Ssl    0:19 /usr/bin/python /usr/bin/swift-object-replicator /etc/swift/object-server.conf
28039 ?        Ss     0:04 /usr/bin/python /usr/bin/swift-object-auditor /etc/swift/object-server.conf
28044 ?        S      1:44 /usr/bin/python /usr/bin/swift-object-auditor /etc/swift/object-server.conf

That is repeatable using systemctl stop (servicename)

[root@turing openstack-dashboard]# rpm -q openstack-swift
openstack-swift-1.7.2-1.fc18.noarch

Comment 1 Pete Zaitcev 2012-11-01 22:18:11 UTC
Derek is on vacation, I'm going to take a look at this.

Comment 2 Derek Higgins 2012-11-01 23:04:28 UTC
Thanks Pete, this can probably be marked as a duplicate of 
https://bugzilla.redhat.com/show_bug.cgi?id=807170

Comment 3 Pete Zaitcev 2012-11-02 00:46:18 UTC
Good eye, Derek. I see now that Mattias server only has auditors, replicators
and updaters remaining: no servers! But it's not so clear to me that it's
merely missing unit files, because systemd is supposed to be able to terminate
any children of services, no matter how they are daemonized.

I assume Mattias started everything with systemctl too, not swift-init
(is that correct?).

Comment 4 Matthias Runge 2012-11-02 07:32:10 UTC
(In reply to comment #3)
> I assume Mattias started everything with systemctl too, not swift-init
> (is that correct?).
Yes, that is correct. Started via systemctl and also tried to stop it via systemctl.

I'm not sure, if this is a duplicate of bz#807170:

[root@turing system]# ls -l /lib/systemd/system/openstack-swift-*
-rwxr-xr-x. 1 root root 247 Sep 20 19:42 /lib/systemd/system/openstack-swift-account.service
-rwxr-xr-x. 1 root root 262 Sep 20 19:42 /lib/systemd/system/openstack-swift-account@.service
-rwxr-xr-x. 1 root root 253 Sep 20 19:42 /lib/systemd/system/openstack-swift-container.service
-rwxr-xr-x. 1 root root 268 Sep 20 19:42 /lib/systemd/system/openstack-swift-container@.service
-rwxr-xr-x. 1 root root 244 Sep 20 19:42 /lib/systemd/system/openstack-swift-object.service
-rwxr-xr-x. 1 root root 259 Sep 20 19:42 /lib/systemd/system/openstack-swift-object@.service
-rwxr-xr-x. 1 root root 241 Sep 20 19:42 /lib/systemd/system/openstack-swift-proxy.service

It seems, I don't have swift-init (or else) as systemd unit.

Comment 5 Derek Higgins 2012-11-02 09:46:25 UTC
swift-init isn't a systemd unit file it is a service starter provided by upstream swift.

matthias I'm guessing those services your looking at were started by openstack-demo-install (using swift-init)
https://github.com/fedora-openstack/openstack-utils/blob/5c1a74bbbb173611d9a1071af361ad44ff0602b5/utils/openstack-demo-install#L304
the systemd unit files your looking at only start/stop the main http servers

I think the main issue we have here is that we need systemd unit files to start all of these services.

Comment 6 Matthias Runge 2012-11-02 12:06:00 UTC
When not using systemctl to start openstack-swift-services, I shouldn't see this, right?

[root@turing ~]# systemctl status openstack-swift-object.service 
openstack-swift-object.service - OpenStack Object Storage (swift) - Object Server
	  Loaded: loaded (/usr/lib/systemd/system/openstack-swift-object.service; enabled)
	  Active: active (running) since Fri, 02 Nov 2012 09:03:24 +0100; 4h 0min ago
	Main PID: 9396 (swift-object-se)
	  CGroup: name=systemd:/system/openstack-swift-object.service
		  ├ 9396 /usr/bin/python /usr/bin/swift-object-server /etc/...
		  ├ 9417 /usr/bin/python /usr/bin/swift-object-server /etc/...
		  ├ 9418 /usr/bin/python /usr/bin/swift-object-server /etc/...
		  └ 9419 /usr/bin/python /usr/bin/swift-object-server /etc/...

Nov 02 09:03:24 turing.berg.ol swift-object-se[9396]: object-server Started c...
Nov 02 09:03:24 turing.berg.ol swift-object-se[9396]: object-server Started c...
Nov 02 09:03:24 turing.berg.ol swift-object-se[9396]: object-server Started c...

So basically, I'm able to start swift services via systemctl, but not to stop them....

Derek, I'm sure, I rebooted that machine after demo-install.

Comment 7 Derek Higgins 2012-11-02 12:25:59 UTC
(In reply to comment #6)
> When not using systemctl to start openstack-swift-services, I shouldn't see
> this, right?
> 
> [root@turing ~]# systemctl status openstack-swift-object.service 
> openstack-swift-object.service - OpenStack Object Storage (swift) - Object
> Server
> 	  Loaded: loaded (/usr/lib/systemd/system/openstack-swift-object.service;
> enabled)
> 	  Active: active (running) since Fri, 02 Nov 2012 09:03:24 +0100; 4h 0min
> ago
> 	Main PID: 9396 (swift-object-se)
> 	  CGroup: name=systemd:/system/openstack-swift-object.service
> 		  ├ 9396 /usr/bin/python /usr/bin/swift-object-server /etc/...
> 		  ├ 9417 /usr/bin/python /usr/bin/swift-object-server /etc/...
> 		  ├ 9418 /usr/bin/python /usr/bin/swift-object-server /etc/...
> 		  └ 9419 /usr/bin/python /usr/bin/swift-object-server /etc/...
> 
> Nov 02 09:03:24 turing.berg.ol swift-object-se[9396]: object-server Started
> c...
> Nov 02 09:03:24 turing.berg.ol swift-object-se[9396]: object-server Started
> c...
> Nov 02 09:03:24 turing.berg.ol swift-object-se[9396]: object-server Started
> c...
> 
> So basically, I'm able to start swift services via systemctl, but not to
> stop them...
that particular service you would see with systemctl we have systemd unit files for 4 swift services openstack-swift-{account,container,object,proxy}, these are what you listed in comment 4, the other services you listed in the original description aren't covered by the systemd unit files. the fact that we have both cases in our swift packaging is probably what is causing confusion

see this loop in openstack-demo-install starting services with both service and swift-init
https://github.com/fedora-openstack/openstack-utils/blob/5c1a74bbbb173611d9a1071af361ad44ff0602b5/utils/openstack-demo-install#L299

> Derek, I'm sure, I rebooted that machine after demo-install.
that should have killed them, I've tried it here just now, so I can't explain this,

Comment 8 Pete Zaitcev 2012-11-03 05:29:20 UTC
In short, it's plain impossible to start (or stop) the processes that were
listed in the original report, while using systemctl. An invocation of
swift-init mush have occured for them to run at all. I verified this on
rawhide too, to make sure nobody fixed bz#807170 while I was looking the
other way.

Comment 9 Matthias Runge 2012-11-03 19:34:43 UTC
Right after system startup:
[mrunge@turing ~]$ ps ax | grep swift
  749 ?        Ss     0:00 /usr/bin/python /usr/bin/swift-account-server /etc/swift/account-server.conf
  754 ?        Ss     0:00 /usr/bin/python /usr/bin/swift-object-server /etc/swift/object-server.conf
  768 ?        Ss     0:00 /usr/bin/python /usr/bin/swift-proxy-server /etc/swift/proxy-server.conf
  775 ?        Ss     0:00 /usr/bin/python /usr/bin/swift-container-server /etc/swift/container-server.conf
 1260 ?        S      0:00 /usr/bin/python /usr/bin/swift-container-server /etc/swift/container-server.conf
 1261 ?        S      0:00 /usr/bin/python /usr/bin/swift-object-server /etc/swift/object-server.conf
 1262 ?        S      0:00 /usr/bin/python /usr/bin/swift-object-server /etc/swift/object-server.conf
 1263 ?        S      0:00 /usr/bin/python /usr/bin/swift-object-server /etc/swift/object-server.conf
 1264 ?        S      0:00 /usr/bin/python /usr/bin/swift-account-server /etc/swift/account-server.conf
 1265 ?        S      0:00 /usr/bin/python /usr/bin/swift-container-server /etc/swift/container-server.conf
 1266 ?        S      0:00 /usr/bin/python /usr/bin/swift-account-server /etc/swift/account-server.conf
 1409 ?        S      0:00 /usr/bin/python /usr/bin/swift-proxy-server /etc/swift/proxy-server.conf
 1410 ?        S      0:00 /usr/bin/python /usr/bin/swift-proxy-server /etc/swift/proxy-server.conf
 1411 ?        S      0:00 /usr/bin/python /usr/bin/swift-proxy-server /etc/swift/proxy-server.conf
 1412 ?        S      0:00 /usr/bin/python /usr/bin/swift-proxy-server /etc/swift/proxy-server.conf
 1413 ?        S      0:00 /usr/bin/python /usr/bin/swift-proxy-server /etc/swift/proxy-server.conf
 1414 ?        S      0:00 /usr/bin/python /usr/bin/swift-proxy-server /etc/swift/proxy-server.conf
 1415 ?        S      0:00 /usr/bin/python /usr/bin/swift-proxy-server /etc/swift/proxy-server.conf
 1416 ?        S      0:00 /usr/bin/python /usr/bin/swift-proxy-server /etc/swift/proxy-server.conf

[mrunge@turing ~]$ ls -l /etc/init.d/sw*
ls: cannot access /etc/init.d/sw*: No such file or directory
-> no sysv init script

[mrunge@turing ~]$ ls -l /lib/systemd/system/openstack-swift-*
-rwxr-xr-x. 1 root root 247 Sep 20 19:42 /lib/systemd/system/openstack-swift-account.service
-rwxr-xr-x. 1 root root 262 Sep 20 19:42 /lib/systemd/system/openstack-swift-account@.service
-rwxr-xr-x. 1 root root 253 Sep 20 19:42 /lib/systemd/system/openstack-swift-container.service
-rwxr-xr-x. 1 root root 268 Sep 20 19:42 /lib/systemd/system/openstack-swift-container@.service
-rwxr-xr-x. 1 root root 244 Sep 20 19:42 /lib/systemd/system/openstack-swift-object.service
-rwxr-xr-x. 1 root root 259 Sep 20 19:42 /lib/systemd/system/openstack-swift-object@.service
-rwxr-xr-x. 1 root root 241 Sep 20 19:42 /lib/systemd/system/openstack-swift-proxy.service

e.g. [root@turing ~]# systemctl status openstack-swift-account.service 
openstack-swift-account.service - OpenStack Object Storage (swift) - Account Server
	  Loaded: loaded (/usr/lib/systemd/system/openstack-swift-account.service; enabled)
	  Active: active (running) since Sun, 04 Nov 2012 04:21:38 +0100
	Main PID: 749 (swift-account-s)
	  CGroup: name=systemd:/system/openstack-swift-account.service
		  ├  749 /usr/bin/python /usr/bin/swift-account-server /etc...
		  ├ 1264 /usr/bin/python /usr/bin/swift-account-server /etc...
		  └ 1266 /usr/bin/python /usr/bin/swift-account-server /etc...

Nov 04 04:21:45 turing.berg.ol swift-account-s[749]: account-server Started c...
Nov 04 04:21:45 turing.berg.ol swift-account-s[749]: account-server Started c...

/lib/systemd/system/openstack-swift-account.service:
[Unit]
Description=OpenStack Object Storage (swift) - Account Server
After=syslog.target network.target

[Service]
Type=simple
User=swift
ExecStart=/usr/bin/swift-account-server /etc/swift/account-server.conf

[Install]
WantedBy=multi-user.target


looks like a systemd target for me.
[root@turing ~]# rpm -qf /lib/systemd/system/openstack-swift-account.service 
openstack-swift-account-1.7.2-1.fc18.noarch

Comment 10 Derek Higgins 2012-11-05 10:30:53 UTC
Following discussion with Matthias this can be marked as a duplicate of https://bugzilla.redhat.com/show_bug.cgi?id=807170 , we will need to create systemd unit files for 

swift-account-auditor
swift-account-replicator
swift-container-auditor
swift-container-replicator
swift-container-updater
swift-object-auditor
swift-object-replicator
swift-object-updater

and possibly more

*** This bug has been marked as a duplicate of bug 807170 ***


Note You need to log in before you can comment on or make changes to this bug.