1

While I can login to the running container and even enter the Asterisk console, below, can't seem to see the status for the Asterisk service:

ubuntu@ip-172-31-14-19:~$ 
ubuntu@ip-172-31-14-19:~$ sudo docker exec -it 115ac4e433ff bin/bash
bash: warning: setlocale: LC_CTYPE: cannot change locale (en_US.UTF-8): No such file or directory
bash: warning: setlocale: LC_COLLATE: cannot change locale (en_US.UTF-8): No such file or directory
bash: warning: setlocale: LC_MESSAGES: cannot change locale (en_US.UTF-8): No such file or directory
bash: warning: setlocale: LC_NUMERIC: cannot change locale (en_US.UTF-8): No such file or directory
bash: warning: setlocale: LC_TIME: cannot change locale (en_US.UTF-8): No such file or directory
[root@ip-172-31-14-19 /]# 
[root@ip-172-31-14-19 /]# whoami
root
[root@ip-172-31-14-19 /]# 
[root@ip-172-31-14-19 /]# service asterisk status
Redirecting to /bin/systemctl status  asterisk.service
Failed to get D-Bus connection: Operation not permitted
[root@ip-172-31-14-19 /]# 
[root@ip-172-31-14-19 /]# asterisk -rvvv
Asterisk certified/11.6-cert17, Copyright (C) 1999 - 2013 Digium, Inc. 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.
=========================================================================
Connected to Asterisk certified/11.6-cert17 currently running on ip-172-31-14-19 (pid = 1)
ip-172-31-14-19*CLI> 
ip-172-31-14-19*CLI> 

Tried running with exec, beyond that this might be a matter of how the container was created?

From a docker container on AWS.

1 Answer 1

1

This happens for every operating system using SystemD to control services. The "systemctl" command does not do very much - it just uses d-bus to talk to the systemd daemon. But inside a docker container there is no such thing.

You can avoid this error when overriding systemctl with the https://github.com/gdraheim/docker-systemctl-replacement to execute the ExecStart / ExceStop parts of the services directly instead of asking systemd to do so.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.