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

Various systemd-related improvements #302

Merged
merged 6 commits into from
Apr 27, 2017
Merged

Various systemd-related improvements #302

merged 6 commits into from
Apr 27, 2017

Conversation

chewi
Copy link
Contributor

@chewi chewi commented Nov 16, 2016

This fixes Debian/Ubuntu, fixes shutdowns with UNIX sockets, deals with multiple instances, and more.

It fixes #271 and #283. It supersedes #274.

@chewi
Copy link
Contributor Author

chewi commented Nov 21, 2016

Just added a further commit to create a systemd-tmpfiles entry after finding my server did not survive a reboot. At this point, I'm thinking the systemd cookbook would be a nice idea but I'll see what you think of all this first.

@brianbianco
Copy link
Contributor

I usually like to avoid having dependencies on other cookbooks simply because it always seems to eventually cause some sort of headache. However I currently am not steeped to deeply in the systemd world and haven't even looked at that cookbook. It may be a good idea to use it.

@klyonrad
Copy link

What's the status of this one?

Are you planning to merge this Pull Request into the official repo soon? What blocks it?

cc @KieranHayes

@shortdudey123
Copy link
Contributor

@chewi can you rebase this to solve the conflicts?

Unfortunately it's not so great for detecting other init systems. This
should improve service handling on Debian 8.
The existing script calls redis-shutdown against /etc/redis.conf. It
could be fixed to use the correct server instance but the script only
supports TCP and not UNIX sockets.

There is no point in using redis-shutdown anyway as sending the TERM
signal does the same job. This is what systemd does by default.

This changes the stop from being synchronous to asynchronous but that
doesn't matter because systemd is running redis-server in the
foreground. If the shutdown operation takes too long, the server will
be killed after TimeoutStopSec either way.

There is also the added benefit that if the server has crashed, a
failed call to redis-shutdown won't prevent the server from being
started again.
A shared file was previously created in the configure recipe. This
makes things consistent with the other init systems and ensures that
systemd users can use the LWRP alone. Per-instance files are necessary
because the shared file had both hardcoded and global default values.

The path has changed from /usr/lib/systemd to /lib/systemd to support
Debian 8, which doesn't have a merged /usr.
systemctl automatically performs a reload when enabling a service so
it is sufficient to enable it in the usual way via action :enable. See
man systemctl.
Otherwise redis-server will probably not survive a reboot on systems
with /run mounted on tmpfs.
@chewi
Copy link
Contributor Author

chewi commented Apr 26, 2017

Done.

@shortdudey123
Copy link
Contributor

Thanks!

@shortdudey123 shortdudey123 merged commit c40e8a7 into sous-chefs:master Apr 27, 2017
@chewi chewi deleted the systemd branch April 27, 2017 08:30
shortdudey123 added a commit that referenced this pull request May 10, 2017
- Update 'bind' config comments ([#293](#293))
- Add disable_os_default recipe ([#224](#224))
- Use the config's ulimits if set and is > max_clients ([#234](#234))
- Add Travis config ([#299](#299))
- Fix test failures (FoodCritic and Rubocop) ([#298](#298))
- Fix TravisCI builds ([#300](#300))
- Add repl-backlog-size, repl-backlog-ttl, and aof-load-truncated options ([#278](#278))
- Add sentinel_bind to bind sentinel to different IPs ([#306](#306))
- Cleanup deprecation warnings ([#301](#301))
- Fix version detection with epoch version numbers from deb/ubuntu ([#294](#294))
- Restrict VM redis config to <= 2.4 ([#322](#322))
- Rename_commands should be checked for nil before empty ([#311](#311))
- Fixup foodcritic, rubocop, and kitchen testing ([#324](#324))
  - Note: this drops support for Chef < 11
- Add min-slaves redis options ([#313](#313))
- Allow /etc/init start after sigterm from system or user ([#310](#310))
- Check user existence with Etc, not ohai node attributes ([#303](#303))
- Various systemd-related improvements ([#302](#302))
- Update serverspec testing with correct OS's for systemd ([#329](#329))
- Add kitchen-dokken testing to Travis ([#330](#330))
- Add fedora-25 to kitchen testing and clean up kitchen config ([#331](#331))
- Fix systemd paths for sentinel service ([#332](#332))
- Add redis-package and sentinel to Travis kitchen verify ([#334](#334))
- Add breadcrumb-file creation condition as attribute ([#268](#268))
- Fix cluster options in README ([#333](#333))
- Fix systemd loader to use descriptors instead of max_clients+32 ([#338](#338))
- Add SELinux support ([#305](#305))
- Make source of redis.conf template configurable ([#341](#341))
- Support sentinel notification-script and client-reconfig-script ([#342](#342))
@lock
Copy link

lock bot commented Nov 28, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Nov 28, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing /usr/bin/redis-shutdown script
4 participants