Maybe trivial question, but I cannot find an answer: How to autostart Asterisk (daemon) on Slackware 10? I know that I should put something in /etc/rc.d, but what?
Goran Dj. wrote:>Maybe trivial question, but I cannot find an answer: > >How to autostart Asterisk (daemon) on Slackware 10? I know that I should >put something in /etc/rc.d, but what? > > > >In my /etc/rc.d/rc.local # Put any local setup commands in here: /sbin/ztcfg /etc/rc.d/rc.hdlc /usr/sbin/asterisk>_______________________________________________ >Asterisk-Users mailing list >Asterisk-Users@lists.digium.com >http://lists.digium.com/mailman/listinfo/asterisk-users >To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users > >
On February 15, 2005 10:49 am, Goran Dj. wrote:> How to autostart Asterisk (daemon) on Slackware 10? I know that I should > put something in /etc/rc.d, but what?Something like /usr/sbin/asterisk -g in /etc/rc.d/rc.local would do it. You can craft up more complex things if you like, wrap safe_asterisk or do whatver, but that'll get you started. -A.
Mr. James W. Laferriere
2005-Feb-15 18:30 UTC
[Asterisk-Users] Autostart Asterisk on Slackware?
Hello Goran , Try this ... Please watch out for any wrapped lines . Hth , JimL cat << EOF > /etc/rc.d/rc.asterisk #!/bin/sh # --verbose # Start the ASTERISK server. PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin NAME=asterisk DESC="Asterisk PBX" # Full path to safe_asterisk script SAFE_ASTERISK=/usr/sbin/safe_asterisk ASTERISKDBN=asterisk ASTERISKDN=/usr/sbin/${ASTERISKDBN} ASTERISKCNFD=/etc/${ASTERISKDBN} # Leave this set unless you know what you are doing. export LD_ASSUME_KERNEL=2.4.1 # set -e OPTS="-d -v -v -v" # usage rc.asterisk , start/stop/restart/reload usage() { echo "Usage: $0 {start|stop|restart|reload}" } TCMD="$1" if [ -f ${ASTERISKDN} -a -d ${ASTERISKCNFD} ]; then case "$1" in start) [ "$TCMD" = "start" ] && \ echo -e "\tStarting ${DESC}" if [ "$OPTS" = "" ]; then $ASTERISKDN else $ASTERISKDN ${OPTS} >> /var/log/asterisk/debug 2>&1 & fi ;; stop) [ "$TCMD" = "stop" ] && \ echo -e "\tStopping ${DESC}" $ASTERISKDN -rx 'stop now' 2>/dev/null > /dev/null ;; reload) echo -e "\tReloading ${DESC}" $ASTERISKDN -rx 'reload' 2>/dev/null > /dev/null ;; restart) echo -e "\tRestarting ${DESC}" $ASTERISKDN -rx 'restart gracefully' 2>/dev/null > /dev/null ;; *) usage ;; esac else echo -e "\t${ASTERISKDN} or ${ASTERISKCNFD} , Does not exist ." echo -e "\tPlease correct and re-reun this startup script" fi EOF On Tue, 15 Feb 2005, Goran Dj. wrote:> Maybe trivial question, but I cannot find an answer: > How to autostart Asterisk (daemon) on Slackware 10? I know that I should > put something in /etc/rc.d, but what?-- +------------------------------------------------------------------+ | James W. Laferriere | System Techniques | Give me VMS | | Network Engineer | 3542 Broken Yoke Dr. | Give me Linux | | babydr@baby-dragons.com | Billings , MT. 59105 | only on AXP | +------------------------------------------------------------------+