pydoc.init 600 B

12345678910111213141516171819202122232425
  1. #!/sbin/openrc-run
  2. # Copyright 1999-2016 Gentoo Foundation
  3. # Distributed under the terms of the GNU General Public Licence v2
  4. start() {
  5. local pydoc_port="${@PYDOC_PORT_VARIABLE@-${PYDOC_PORT}}"
  6. if [ -z "${pydoc_port}" ]; then
  7. eerror "Port not set"
  8. return 1
  9. fi
  10. ebegin "Starting pydoc server on port ${pydoc_port}"
  11. start-stop-daemon --start --background --make-pidfile \
  12. --pidfile /var/run/@PYDOC@.pid \
  13. --exec /usr/bin/@PYDOC@ -- -p "${pydoc_port}"
  14. eend $?
  15. }
  16. stop() {
  17. ebegin "Stopping pydoc server"
  18. start-stop-daemon --stop --quiet --pidfile /var/run/@PYDOC@.pid
  19. eend $?
  20. }