keepalived.init 792 B

12345678910111213141516171819202122232425262728293031323334
  1. #!/sbin/openrc-run
  2. # Copyright 1999-2013 Gentoo Foundation
  3. # Distributed under the terms of the GNU General Public License v2
  4. depend() {
  5. use logger
  6. # The interfaces do not actually need to exist to start, it handles them gracefully.
  7. use net
  8. }
  9. command="/usr/sbin/keepalived"
  10. command_args="${KEEPALIVED_OPTS}"
  11. pidfile="/var/run/keepalived.pid"
  12. extra_commands="checkconfig reload"
  13. checkconfig() {
  14. # keepalived has a config check command, but it does not work while the daemon is running!
  15. if [ ! -e /etc/keepalived/keepalived.conf ] ; then
  16. eerror "You need an /etc/keepalived/keepalived.conf file to run keepalived"
  17. return 1
  18. fi
  19. }
  20. start_pre() {
  21. checkconfig || return 1
  22. }
  23. reload() {
  24. ebegin "Reloading keepalived.conf"
  25. start-stop-daemon --pidfile $pidfile --signal HUP
  26. eend $?
  27. }