Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 634634 - sys-apps/openrc-0.32.1 fails to start sshd on the host when LXC container contains running sshd
Summary: sys-apps/openrc-0.32.1 fails to start sshd on the host when LXC container con...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: OpenRC (show other bugs)
Hardware: All Linux
: Normal major with 1 vote (vote)
Assignee: OpenRC Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-10-18 13:02 UTC by Aljoscha Vollmerhaus
Modified: 2017-10-27 07:56 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
0001-rc_find_pids-skip-pids-in-different-pid-namespaces.patch (0001-rc_find_pids-skip-pids-in-different-pid-namespaces.patch,1.71 KB, patch)
2017-10-21 22:25 UTC, William Hubbs
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Aljoscha Vollmerhaus 2017-10-18 13:02:10 UTC
Situation: I'm running containers via LXC, they have their own IP address and do not share any filesystem with the host.

When trying to start sshd on the host, /etc/init.d/sshd refuses to start because start-stop-daemon believes sshd to be already running. /run/sshd.pid does not exist, neither does /run/openrc/started/sshd.
/var/run is a symlink to /run.

This can easily be reproduced with "start-stop-daemon --start --exec /usr/sbin/sshd --pidfile /run/nonexistent".
Stopping sshd in the containers makes the problem go away, but this is no solution of course.
Manually running sshd via "/usr/bin/sshd" works fine.

Not sure if it matters, but the container still runs openrc 0.28

Reproducible: Always

Steps to Reproduce:
1. Create and start LXC containers with sshd enabled
2. Try to start sshd on the host
Actual Results:  
"start-stop-daemon: /usr/sbin/sshd is already running"

Expected Results:  
Start sshd

The containers are still on sys-apps/openrc-0.28
Comment 1 Ciprian Ciubotariu 2017-10-18 16:10:06 UTC
Same behavior for samba and vixie-cron
Comment 2 Ciprian Ciubotariu 2017-10-18 16:11:58 UTC
I also reported this as https://bugs.gentoo.org/634362. I guess this changes the status to CONFIRMED
Comment 3 Aljoscha Vollmerhaus 2017-10-19 09:14:15 UTC
As a workaround, I've changed my boot order to start sshd on the host before any LXC containers are started.
Comment 4 William Hubbs gentoo-dev 2017-10-21 22:25:03 UTC
Created attachment 499594 [details, diff]
0001-rc_find_pids-skip-pids-in-different-pid-namespaces.patch

Hi,

can you please apply this patch and let me know if it fixes your issue?
only consider pids that share our pid namespace.
Comment 5 Ciprian Ciubotariu 2017-10-24 12:37:52 UTC
Thanks for the patch. I will test it as soon as possible, but these computers are headless so setting everything up will take a while.
Comment 6 Milan Beneš 2017-10-24 12:46:50 UTC
Hello,
I gave the patch a try and everything seems OK.
Comment 7 William Hubbs gentoo-dev 2017-10-24 15:46:20 UTC
The patch is applied in the following commit and will be in 0.34.

https://github.com/openrc/openrc/commit/f5acc66db7d1a0bfad6a40eefc0240b80f52df94
Comment 8 Aljoscha Vollmerhaus 2017-10-27 07:56:45 UTC
I just merged sys-apps/openrc-0.34.2 and everything is working as expected.
Many thanks for the quick fix!