Anope IRC Services

Please login or register.

Login with username, password and session length
Advanced search  

News:

Pages: [1]   Go Down

Author Topic: gentoo init script  (Read 3491 times)

0 Members and 1 Guest are viewing this topic.

someone

  • Anope User
  • Offline Offline
  • Gender: Male
  • Posts: 42
    • http://www.somenet.org
gentoo init script
« on: October 24, 2010, 11:53:21 PM »

As I am testing anope on a gentoo box, i needed to write my own init script.
it demands that anope is in "/anope" and your nonprivileged anope-user is "anope"
Pretty minimalistic, but enought, to run anope on reboot.
One might find this one useful.

Code: [Select]
#!/sbin/runscript
# anope IRC-Services init script for gentoo.
# Author: someone (someone@somenet.org)

depend() {
  need ircd
}

start() {
  ebegin "Starting anope"
  cd /anope
  rm -rf data/modules/runtime/*
  start-stop-daemon --start --background --make-pidfile --user anope --pidfile /var/run/anope.pid --exec ./anope -- -n
  eend $?
}

stop() {
  ebegin "Stopping anope"
  start-stop-daemon --stop --pidfile /var/run/anope.pid
#  killall -u anope
  eend $?
}

opts="${opts} restartd"
restartd() {
  stop
  sleep 8    # Wait 8 seconds before starting again
  start
}

Ty for your effort with anope 1.9!
« Last Edit: October 25, 2010, 02:26:31 AM by someone »
Logged
Pages: [1]   Go Up