ogp_agent.init.gentoo 657 B

12345678910111213141516171819202122232425
  1. #!/sbin/runscript
  2. # Distributed under the terms of the GNU General Public License v2
  3. # GF: Config is in $agent_dir/Cfg/Config.pm
  4. agent_dir=OGP_AGENT_DIR
  5. agent_user=OGP_USER
  6. depend() {
  7. need net
  8. }
  9. start() {
  10. ebegin "Starting OGP Agent"
  11. start-stop-daemon --verbose --chdir $agent_dir --start --background --user $agent_user -e PWD="$agent_dir" --exec screen -d -m -t ogp_agent -c ogp_screenrc -S ogp_agent ./ogp_agent_run -pidfile ogp_agent_run.pid
  12. eend $? "Failed to start OGP Agent"
  13. }
  14. stop() {
  15. ebegin "Stopping OGP Agent"
  16. start-stop-daemon --stop --quiet --pidfile $agent_dir/ogp_agent_run.pid
  17. eend $? "Failed to stop OGP Agent"
  18. }