Bug 14415 - Cannot stop weston service on systemd
Summary: Cannot stop weston service on systemd
Status: RESOLVED WONTFIX
Alias: None
Product: Runtime
Classification: Build System, Metadata & Runtime
Component: build-appliance (show other bugs)
Version: 3.2.3
Hardware: All Multiple
: Medium normal
Target Milestone: 3.4
Assignee: Joshua Watt
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2021-06-01 10:11 UTC by Markus Bauer
Modified: 2021-07-01 15:22 UTC (History)
1 user (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Bauer 2021-06-01 10:11:15 UTC
Hi everyone.

When I build a systemd rootfs/kernel, including weston (core-image-weston), weston comes up fine, but I am not able to stop it. Neither

`systemctl stop weston`
nor
`service weston stop`
works.

The reason is, that `/etc/init.d/weston` has "killproc weston" inside it - but on systemd `/etc/init.d/weston stop` the call of the init.d file generates a pid which is found by `/bin/pidof weston` also. This means, the "stop" call is killed before it's able to kill weston.

My hotfix is the following:


`
stop)
        echo "Stopping Weston"
        killproc /usr/bin/weston
  ;;
`

But what if you are running weston on multiple VT's? Wouldn't it be better if weston service would leave a pid and we could kill exactly that pid?


Best Regards

Markus Bauer
Comment 1 Joshua Watt 2021-06-03 15:14:30 UTC
What version of Yocto are you using? The latest versions have a dedicated systemd service for dealing with weston, so that should be used instead of the sysvinit scripts.
Comment 2 Markus Bauer 2021-06-07 06:36:57 UTC
I use poky Gatesgarth - 3.2.3. 

The `service weston stop` call is not working for me.
Comment 3 Stephen K Jolley 2021-06-12 05:34:10 UTC
Question answered.  Ask another question in you want it in NEEDINFO.
Comment 4 Joshua Watt 2021-06-12 15:47:17 UTC
Sorry, I'm having a little trouble understanding why the sysvinit scripts are being used to start and stop Weston when systemd is in use. There are specific systemd services for Weston that should be used in stead. Can you clarify?
Comment 5 Markus Bauer 2021-06-14 06:06:10 UTC
No, I can't. I just see that it's not working - neither `/etc/init.d/weston stop` nor `service weston stop` works.
Are you able to reproduce this?
Comment 6 Joshua Watt 2021-07-01 15:22:18 UTC
If systemd is enable, you really need to use it to start and stop weston instead of the sysvinit scripts. If you can reproduce the same issue without systemd, please reopen the bug.