Asterisk hang when trying to access console

I just installed LTS22 on debian

When I type

sudo asterisk -cvvvvvvvvvvvvvvvvvv

Unable to access the running directory (Permission denied). Changing to ‘/’ for compatibility.
Asterisk already running on /var/run/asterisk/asterisk.ctl. Use ‘asterisk -r’ to connect

When I type

sudo asterisk -rvvvvvvvvvvvvvvvvvv

Asterisk 22.7.0, Copyright (C) 1999 - 2025, Sangoma Technologies Corporation and others.
Created by Mark Spencer markster@digium.com
Asterisk comes with ABSOLUTELY NO WARRANTY; type ‘core show warranty’ for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type ‘core show license’ for details.

Running as user ‘asterisk’
Running under group ‘asterisk’

and then the window freeze.
I cannot type anything more, I’m obliged to reboot

I beleive there is something to do with user permissions

ps aux | grep bin/asterisk
root 1369 0.0 0.0 3332 1456 pts/0 S+ 17:31 0:00 grep --color=auto bin/asterisk

I tryed my best to make it start not under root but could not, to be honest I do not know how it does start at boot.

It is not in crontab
I did systemctl disable asterisk and I remover the asterisk file from /etc/init.d

So I do not know :

why it does start at boot ?
Why it does start under root ?
Why I cannot access to the console ?
how can I handle all that ?

On Wednesday 31 December 2025 at 17:42:54, Stephan via Asterisk Community
wrote:

I just installed LTS22 on debian

Please tell us which version of Debian, and how you installed Asterisk - was
it the Debian Sid (unstable) package Debian -- Details of package asterisk in sid
or did you build from source?

Thanks,

Antony.


The first fifty percent of an engineering project takes ninety percent of the
time, and the remaining fifty percent takes another ninety percent of the time.

sorry, I forgot that information in my post

it is Debian 6.1.158-1 (2025-11-09) x86_64 GNU/Linux

I builded asterisk from sources yes

I rebuilded it with the –with-jansson-bundled

I removed any configuration file (all files in /etc/asterisk)
it doesn’t change anything

asterisk hang when I type sudo asterisk -rvvvvvvvv

systemctl status asterisk.service

  • asterisk.service - Asterisk PBX and telephony daemon.
    Loaded: loaded (/lib/systemd/system/asterisk.service; disabled; preset: enabled)
    Active: activating (auto-restart) (Result: exit-code) since Fri 2026-01-02 16:14:49 CET; 849ms ago
    TriggeredBy: * asterisk.socket
    Process: 52414 ExecStart=/usr/sbin/asterisk -mqf -C /etc/asterisk/asterisk.conf (code=exited, status=1/FAILURE)
    Main PID: 52414 (code=exited, status=1/FAILURE)
    CPU: 16ms

I cannot find anything in the var/log/asterisk files (all are almost empty)
I do not know where to search

On Friday 02 January 2026 at 16:28:50, Stephan via Asterisk Community wrote:

I cannot find anything in the var/log/asterisk files (all are almost empty)
I do not know where to search

  1. When you built the source code, did you accept all default options, or did
    you change anything to your own preference?

  2. Which user and group is asterisk (configured to be) running as?

  3. does “ldd /usr/sbin/asterisk” show any shared libraries which are not being
    found?

Antony.


“There is no reason for any individual to have a computer in their home.”

  • Ken Olsen, President of Digital Equipment Corporation (DEC, later consumed
    by Compaq, later merged with HP)

Thank you for your answer

1/ except from -with-jansson-un… That I did The second time I compiled it, I did not change anything

2/ I’m logged as root, I builded it as root
I beleive I chown -R asterisk:asterisk all files as it is supposed to run under asterisk user

3/ the result of ldd /usr/sbin/asterisk:

    linux-vdso.so.1 (0x00007fffac5b1000)
    libasteriskssl.so.1 => /usr/lib/libasteriskssl.so.1 (0x00007ff6f6cf6000)
    libasteriskpj.so.2 => /usr/lib/libasteriskpj.so.2 (0x00007ff6f6400000)
    libxml2.so.2 => /lib/x86_64-linux-gnu/libxml2.so.2 (0x00007ff6f6654000)
    libxslt.so.1 => /lib/x86_64-linux-gnu/libxslt.so.1 (0x00007ff6f6cb3000)
    libsqlite3.so.0 => /lib/x86_64-linux-gnu/libsqlite3.so.0 (0x00007ff6f6b54000)
    libssl.so.3 => /lib/x86_64-linux-gnu/libssl.so.3 (0x00007ff6f6357000)
    libcrypto.so.3 => /lib/x86_64-linux-gnu/libcrypto.so.3 (0x00007ff6f5e00000)
    liburiparser.so.1 => /lib/x86_64-linux-gnu/liburiparser.so.1 (0x00007ff6f633e000)
    libuuid.so.1 => /lib/x86_64-linux-gnu/libuuid.so.1 (0x00007ff6f6648000)
    libcrypt.so.1 => /lib/x86_64-linux-gnu/libcrypt.so.1 (0x00007ff6f6302000)
    libcap.so.2 => /lib/x86_64-linux-gnu/libcap.so.2 (0x00007ff6f62f6000)
    libedit.so.2 => /lib/x86_64-linux-gnu/libedit.so.2 (0x00007ff6f62bc000)
    libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007ff6f5a00000)
    libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007ff6f5d20000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007ff6f581e000)
    libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007ff6f629c000)
    libicuuc.so.72 => /lib/x86_64-linux-gnu/libicuuc.so.72 (0x00007ff6f5620000)
    libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007ff6f5d01000)
    liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007ff6f5cd2000)
    /lib64/ld-linux-x86-64.so.2 (0x00007ff6f6d08000)
    libtinfo.so.6 => /lib/x86_64-linux-gnu/libtinfo.so.6 (0x00007ff6f5c9f000)
    libbsd.so.0 => /lib/x86_64-linux-gnu/libbsd.so.0 (0x00007ff6f5c89000)
    libicudata.so.72 => /lib/x86_64-linux-gnu/libicudata.so.72 (0x00007ff6f3800000)
    libmd.so.0 => /lib/x86_64-linux-gnu/libmd.so.0 (0x00007ff6f628f000)

I can’t think of any reason that Asterisk would do anything to block the use of any of Ctrl-C, Ctrl-Z or Ctrl -Alt-Fn.

On Friday 02 January 2026 at 17:10:23, Stephan via Asterisk Community wrote:

2/ I’m logged as root, I builded it as root
I believe I chown -R asterisk:asterisk all files as it is supposed to run
under asterisk user

Okay, what do you get for:

grep ASTERISK /etc/default/asterisk

grep run /etc/asterisk/asterisk.conf

grep asterisk /etc/passwd

ls -Ald /etc/asterisk

Also, when you say “chown -R asterisk:asterisk all files” what exactly do you
mean by “all files”? What directory name/s did you give to the chown command?

Antony.


The Magic Words are Squeamish Ossifrage.

and yet, Ctrl-c or z has no effect

I’m obliged to kill the process

Thank you for your help, I’m really lost !

#grep ASTERISK /etc/default/asterisk

#grep run /etc/asterisk/asterisk.conf
astrundir => /var/run/asterisk
runuser = asterisk ; The user to run as.
rungroup = asterisk ; The group to run as.

# grep asterisk /etc/passwd
asterisk:x:999:1001::/var/lib/asterisk:/bin/sh

# ls -Ald /etc/asterisk
drwxr-xr-x 4 asterisk asterisk 4096 Jan 2 15:49 /etc/asterisk

What directory name/s did you give to the chown command?

chown –recursive asterisk:asterisk /var/lib/asterisk
chown –recursive asterisk:asterisk /var/log/asterisk
chown –recursive asterisk:asterisk /var/run/asterisk
chown –recursive asterisk:asterisk /var/spool/asterisk
chown –recursive asterisk:asterisk /usr/lib/asterisk

On Friday 02 January 2026 at 18:47:39, Stephan via Asterisk Community wrote:

Thank you for your help, I’m really lost !

Nothing you’ve posted as answers to my questions stands out as unexpected or a
potential reason for your problem.

However, given that you have installed from source Asterisk 22.7.0 on a Debian
machine, and that identical version is available as a Debian package (in sid),
I suggest you try uninstalling what you currently have on the machine and then
install the packaged version instead.

There are some differences in the compiler options between the “standard
Asterisk” build-from-source process and what the Debian maintainers do,
however I suspect these are unlikely to affect your usage of the system, and
it’s almost certainly a far simpler way of getting what you want, installed
and running.

I have been using the packaged Debian version for many years now, and have
never run into a problem where I had to build from source to resolve it.

Unless anyone else can chip in with some furterh suggestions on how to find out
why your machine is behaving the way it is, I think this might be your
simplest and easiest solution.

Antony.


It seems that perfection is attained not when there is nothing left to add, ut
rather when there is nothing left to subtract.

  • Antoine de Saint-Exupery

Use: systemctl disable asterisk

The next time you reboot you can start Asterisk with your command which gives the console screen or ‘sudo asterisk’.

I did disabled asterisk for reboot

when I do

ps -ef | grep asterisk

I only see the grep process so asterisk does not seems to be running

ps -ef | grep asterisk
root 528065 2128 0 19:03 pts/0 00:00:00 grep --color=auto asterisk

however, when I do sudo asterisk I got this

Asterisk already running on /var/run/asterisk/asterisk.ctl. Use ‘asterisk -r’ to connect.

then when I do

sudo asterisk -rvvvvvvvdddddd
Seeding global EID ‘00:15:5d:00:64:02’ from ‘eth0’ using ‘siocgifhwaddr’
Parsing /etc/asterisk/asterisk.conf
Asterisk 22.7.0, Copyright (C) 1999 - 2025, Sangoma Technologies Corporation and others.
Created by Mark Spencer markster@digium.com
Asterisk comes with ABSOLUTELY NO WARRANTY; type ‘core show warranty’ for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type ‘core show license’ for details.

Running as user ‘asterisk’
Running under group ‘asterisk’
Killed

it hang before the killed word. Killed is written when I kill the process

I do not know how to install “the packaged version”

I do not know where to get it neither how to install it
Before I do that I would like to try to compile it again with option

I beleive I have selected several thing in the menuselect (like gsm, binaural, french, …)
I would like to reset the menuselect ‘ option to the default

how can I do that ?

Try:

sudo asterisk -r

core stop now

sudo asterisk -cTvvvvvvvvvv

Adding some '-d’s may also yield clues.

The command may be some variation of:

sudo apt install asterisk

It would probably be a good idea to remove all trace of your current install first. Something like:

sudo find / -xdev |& grep --ignore-case asterisk

Should yield clues.

sudo asterisk -cTvvvvvvvvvvdddddddd
Seeding global EID ‘00:15:5d:00:64:02’ from ‘eth0’ using ‘siocgifhwaddr’
Parsing /etc/asterisk/asterisk.conf
Unable to access the running directory (Permission denied). Changing to ‘/’ for compatibility.
Asterisk already running on /var/run/asterisk/asterisk.ctl. Use ‘asterisk -r’ to connect.

here is the output of sudo find / -xdev |& grep --ignore-case asterisk

list.txt (1.1 MB)

On Sunday 04 January 2026 at 13:52:27, Stephan via Asterisk Community wrote:

how does this remove all traces ?

sudo find / -xdev |& grep --ignore-case asterisk

It doesn’t remove anything - it tells you where things need to be removed
from.

Antony.


I want to build a machine that will be proud of me.

  • Danny Hillis, creator of The Connection Machine

                                                Please reply to the list;
                                                      please don't CC me.