You are not logged in.
Hello. I'm trying to install Asterisk on my arch distro. I followed the simple installing description on wiki and it installed well (./configure..make.. make install), after that I ran make samples to copy the config files. The problem is that the service is not working. When I type sudo systemctl start asterisk it gives me:
Failed to start asterisk.service: Unit asterisk.service not found.
At the asterisk source code folder, I copied the init script (at /asterisk-13.9.1/contrib/init.d/rc.archlinux.asterisk) to the folder /etc/systemd (dunno exactly if this is the right directory) and renaming from rc.archlinux.asterisk to just asterisk, as instructed in this video lesson. The content of the rc.archlinux.asterisk init script is:
. /etc/rc.conf
. /etc/rc.d/functions
DAEMON=/usr/bin/asterisk
ASTVARRUNDIR=/etc/asterisk
case "$1" in
start)
stat_busy "Starting Asterisk..."
if [ ! -d $ASTVARRUNDIR ]; then
mkdir -p $ASTVARRUNDIR
fi
if [ -x $DAEMON ]; then
# Check if Asterisk is already running. If it is, then bug out, because
# starting safe_asterisk when Asterisk is running is very bad.
VERSION=`${DAEMON} -rx 'core show version' 2>/dev/null`
if [ "`echo $VERSION | cut -c 1-8`" = "Asterisk" ]; then
echo "Asterisk is already running. $0 will exit now."
exit 1
fi
${DAEMON}
stat_done
fi
;;
stop)
if [ -r ${ASTVARRUNDIR}/asterisk.pid ]; then
stat_busy "Stopping Asterisk..."
${DAEMON} -rx "core stop now" > /dev/null 2&>1
if [ $? -gt 0 ]; then
stat_fail
else
stat_done
fi
fi
;;
restart)
$0 stop
sleep 2
$0 start
;;
*)
echo "usage $0 start|stop|restart" ;;
esac
exit 0I'm also having a problem with it, when I run, it don't find both /etc/rc.conf /etc/rc.d/functions. I'm sorry for being so noob but I really don't know how to install this service so I can start it later with systemctl, I couldn't find answers at google searches.
Offline
The wiki page recommends using the AUR package (which presumably includes a service file), it says nothing about building manually...
Offline
./configure..make.. make install
You should pretty much never do this on arch. Use a PKGBUILD and makepkg/pacman.
I copied the init script (at /asterisk-13.9.1/contrib/init.d/rc.archlinux.asterisk) to the folder /etc/systemd
This just doesn't make sense. Initscripts and systemd are not the same thing. You can't just drop an init script into systemd and expect it to work like a systemd service file.
Please undo everything you have done. If you are lucky, the makefile will have a complete `uninstall` directive that will get rid of it cleanly, otherwise you have to a bit of investigation.
Once you clean that up, use the aur package already made for this.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline