Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix container death after smbd initializes. #2

Merged
merged 3 commits into from
Jun 24, 2016
Merged

Fix container death after smbd initializes. #2

merged 3 commits into from
Jun 24, 2016

Conversation

charles-m-knox
Copy link

I've seen this in a couple different rpi-samba images. Basically something like this happens:

Creating network "networkshares_default" with the default driver
Creating networkshares_500hdd1_1
Attaching to networkshares_500hdd1_1
500hdd1_1  | Add user 'osmc' with password 'pwd' Added user osmc.
500hdd1_1  | DONE
500hdd1_1  | Add user 'chuck' with password 'pwd' Added user chuck.
500hdd1_1  | DONE
500hdd1_1  | Add share '500hdd1' path '/share/data' read+write for users: osmc chuck DONE
500hdd1_1  | smbd version 4.2.11 started.
500hdd1_1  | Copyright Andrew Tridgell and the Samba Team 1992-2014
500hdd1_1  | STATUS=daemon 'smbd' finished starting up and ready to serve connections
networkshares_500hdd1_1 exited with code 0

This fixes the issue, somehow - thanks to this stack exchange article: http://unix.stackexchange.com/a/277119

After building the image -- you can pull it via docker pull charlesmknox/rpi-samba if you want to test -- the container no longer exits with code 0:

Creating network "networkshares_default" with the default driver
Creating networkshares_500hdd1_1
Attaching to networkshares_500hdd1_1
500hdd1_1  | Add user 'osmc' with password 'pwd' Added user osmc.
500hdd1_1  | DONE
500hdd1_1  | Add user 'chuck' with password 'pwd' Added user chuck.
500hdd1_1  | DONE
500hdd1_1  | Add share '500hdd1' path '/share/data' read+write for users: osmc chuck DONE
500hdd1_1  | smbd version 4.2.11 started.
500hdd1_1  | Copyright Andrew Tridgell and the Samba Team 1992-2014
500hdd1_1  | STATUS=daemon 'smbd' finished starting up and ready to serve connections

The fix is simply to append < /dev/null to the last line in /run.sh. Why does this work? I don't know. But it works, and on top of that, my share works too!

@charles-m-knox
Copy link
Author

The other two commits were just interim changes while I tested the change, just look at the "Files Changed" tab to see what this pull request will alter.

@dastrasmue dastrasmue merged commit 9cdff19 into dastrasmue:master Jun 24, 2016
@dastrasmue
Copy link
Owner

Thanks Chuck, I wasn't aware of this bug. I will also create a new container Version for the docker hub.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants