Discussion:
[lxc-users] Freeswitch refuses to start in Debian Jessie
Rajil Saraswat
2018-01-07 16:35:20 UTC
Permalink
Hello,

I am trying to setup freeswitch in Debian Jessie. The host is Gentoo
linux running lxc-2.0.9

Error is,

# systemctl status freeswitch.service
● freeswitch.service - freeswitch
   Loaded: loaded (/lib/systemd/system/freeswitch.service; enabled)
   Active: failed (Result: start-limit) since Sun 2018-01-07 16:28:38
UTC; 1s ago
  Process: 7900 ExecStartPre=/bin/mkdir -p /var/run/freeswitch/
(code=exited, status=214/SETSCHEDULER)

Jan 07 16:28:38 jessie systemd[1]: Failed to start freeswitch.
Jan 07 16:28:38 jessie systemd[1]: Unit freeswitch.service entered
failed state.
Jan 07 16:28:38 jessie systemd[1]: freeswitch.service holdoff time over,
scheduling restart.
Jan 07 16:28:38 jessie systemd[1]: Stopping freeswitch...
Jan 07 16:28:38 jessie systemd[1]: Starting freeswitch...
Jan 07 16:28:38 jessie systemd[1]: freeswitch.service start request
repeated too quickly, refusing to start.
Jan 07 16:28:38 jessie systemd[1]: Failed to start freeswitch.
Jan 07 16:28:38 jessie systemd[1]: Unit freeswitch.service entered
failed state.

#journalctl -xe

Jan 07 16:28:38 jessie systemd[1]: Starting freeswitch...
-- Subject: Unit freeswitch.service has begun with start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit freeswitch.service has begun starting up.
Jan 07 16:28:38 jessie systemd[7900]: Failed at step SETSCHEDULER
spawning /bin/mkdir: Operation not permitted
-- Subject: Process /bin/mkdir could not be executed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- The process /bin/mkdir could not be executed and failed.
--
-- The error number returned while executing this process is 1.
Jan 07 16:28:38 jessie systemd[1]: freeswitch.service: control process
exited, code=exited status=214
Jan 07 16:28:38 jessie systemd[1]: Failed to start freeswitch.
-- Subject: Unit freeswitch.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit freeswitch.service has failed.
--
-- The result is failed.

The startup script is,


# cat /lib/systemd/system/freeswitch.service

[Unit]
Description=freeswitch
After=syslog.target network.target local-fs.target postgresql.service

[Service]
; service
Type=forking
PIDFile=/run/freeswitch/freeswitch.pid
Environment="DAEMON_OPTS=-nonat"
EnvironmentFile=-/etc/default/freeswitch
ExecStartPre=/bin/mkdir -p /var/run/freeswitch/
ExecStartPre=/bin/chown -R www-data:www-data /var/run/freeswitch/
ExecStart=/usr/bin/freeswitch -u www-data -g www-data -ncwait $DAEMON_OPTS
TimeoutSec=45s
Restart=always
; exec
User=root
Group=daemon
LimitCORE=infinity
LimitNOFILE=100000
LimitNPROC=60000
LimitSTACK=250000
LimitRTPRIO=infinity
LimitRTTIME=infinity
IOSchedulingClass=realtime
IOSchedulingPriority=2
CPUSchedulingPolicy=rr
CPUSchedulingPriority=89
UMask=0007

[Install]
WantedBy=multi-user.target

Any idea how to fix this?

Thanks
Stéphane Graber
2018-01-08 01:46:40 UTC
Permalink
Anything weird going on with your /var/run?

Looks like what's failing is:

/bin/mkdir -p /var/run/freeswitch/
Post by Rajil Saraswat
Hello,
I am trying to setup freeswitch in Debian Jessie. The host is Gentoo
linux running lxc-2.0.9
Error is,
# systemctl status freeswitch.service
● freeswitch.service - freeswitch
   Loaded: loaded (/lib/systemd/system/freeswitch.service; enabled)
   Active: failed (Result: start-limit) since Sun 2018-01-07 16:28:38
UTC; 1s ago
  Process: 7900 ExecStartPre=/bin/mkdir -p /var/run/freeswitch/
(code=exited, status=214/SETSCHEDULER)
Jan 07 16:28:38 jessie systemd[1]: Failed to start freeswitch.
Jan 07 16:28:38 jessie systemd[1]: Unit freeswitch.service entered
failed state.
Jan 07 16:28:38 jessie systemd[1]: freeswitch.service holdoff time over,
scheduling restart.
Jan 07 16:28:38 jessie systemd[1]: Stopping freeswitch...
Jan 07 16:28:38 jessie systemd[1]: Starting freeswitch...
Jan 07 16:28:38 jessie systemd[1]: freeswitch.service start request
repeated too quickly, refusing to start.
Jan 07 16:28:38 jessie systemd[1]: Failed to start freeswitch.
Jan 07 16:28:38 jessie systemd[1]: Unit freeswitch.service entered
failed state.
#journalctl -xe
Jan 07 16:28:38 jessie systemd[1]: Starting freeswitch...
-- Subject: Unit freeswitch.service has begun with start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit freeswitch.service has begun starting up.
Jan 07 16:28:38 jessie systemd[7900]: Failed at step SETSCHEDULER
spawning /bin/mkdir: Operation not permitted
-- Subject: Process /bin/mkdir could not be executed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- The process /bin/mkdir could not be executed and failed.
--
-- The error number returned while executing this process is 1.
Jan 07 16:28:38 jessie systemd[1]: freeswitch.service: control process
exited, code=exited status=214
Jan 07 16:28:38 jessie systemd[1]: Failed to start freeswitch.
-- Subject: Unit freeswitch.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit freeswitch.service has failed.
--
-- The result is failed.
The startup script is,
# cat /lib/systemd/system/freeswitch.service
[Unit]
Description=freeswitch
After=syslog.target network.target local-fs.target postgresql.service
[Service]
; service
Type=forking
PIDFile=/run/freeswitch/freeswitch.pid
Environment="DAEMON_OPTS=-nonat"
EnvironmentFile=-/etc/default/freeswitch
ExecStartPre=/bin/mkdir -p /var/run/freeswitch/
ExecStartPre=/bin/chown -R www-data:www-data /var/run/freeswitch/
ExecStart=/usr/bin/freeswitch -u www-data -g www-data -ncwait $DAEMON_OPTS
TimeoutSec=45s
Restart=always
; exec
User=root
Group=daemon
LimitCORE=infinity
LimitNOFILE=100000
LimitNPROC=60000
LimitSTACK=250000
LimitRTPRIO=infinity
LimitRTTIME=infinity
IOSchedulingClass=realtime
IOSchedulingPriority=2
CPUSchedulingPolicy=rr
CPUSchedulingPriority=89
UMask=0007
[Install]
WantedBy=multi-user.target
Any idea how to fix this?
Thanks
_______________________________________________
lxc-users mailing list
http://lists.linuxcontainers.org/listinfo/lxc-users
--
Stéphane Graber
Ubuntu developer
http://www.ubuntu.com
Rajil Saraswat
2018-01-08 04:15:19 UTC
Permalink
Post by Stéphane Graber
Anything weird going on with your /var/run?
/bin/mkdir -p /var/run/freeswitch/
Here is what I have,

# ls -la /var/run
lrwxrwxrwx 1 root root 4 Jan  6 00:51 /var/run -> /run

# ls -la /var/run/freeswitch
ls: cannot access /var/run/freeswitch: No such file or directory

I can create the directory manually and give it correct permissions as
required by systemd script.

# /bin/mkdir -p /var/run/freeswitch/
***@jessie:~# chown -R www-data:www-data /var/run/freeswitch
***@jessie:~# ls -la /var/run/freeswitch
total 0
drwxr-xr-x  2 www-data www-data  40 Jan  8 04:11 .
drwxr-xr-x 13 root     root     480 Jan  8 04:11 ..

However, Freeswitch still fails,

# systemctl start freeswitch.service
Job for freeswitch.service failed. See 'systemctl status
freeswitch.service' and 'journalctl -xn' for details.
***@jessie:~# systemctl status freeswitch.service
● freeswitch.service - freeswitch
   Loaded: loaded (/lib/systemd/system/freeswitch.service; enabled)
   Active: failed (Result: start-limit) since Mon 2018-01-08 04:14:16
UTC; 1s ago
  Process: 453 ExecStartPre=/bin/mkdir -p /var/run/freeswitch/
(code=exited, status=214/SETSCHEDULER)

Jan 08 04:14:16 jessie systemd[1]: Failed to start freeswitch.
Jan 08 04:14:16 jessie systemd[1]: Unit freeswitch.service entered
failed state.
Jan 08 04:14:16 jessie systemd[1]: freeswitch.service holdoff time over,
scheduling restart.
Jan 08 04:14:16 jessie systemd[1]: Stopping freeswitch...
Jan 08 04:14:16 jessie systemd[1]: Starting freeswitch...
Jan 08 04:14:16 jessie systemd[1]: freeswitch.service start request
repeated too quickly, refusing to start.
Jan 08 04:14:16 jessie systemd[1]: Failed to start freeswitch.
Jan 08 04:14:16 jessie systemd[1]: Unit freeswitch.service entered
failed state.
Stéphane Graber
2018-01-08 04:41:38 UTC
Permalink
Post by Stéphane Graber
Anything weird going on with your /var/run?
/bin/mkdir -p /var/run/freeswitch/
Post by Rajil Saraswat
Hello,
I am trying to setup freeswitch in Debian Jessie. The host is Gentoo
linux running lxc-2.0.9
Error is,
# systemctl status freeswitch.service
● freeswitch.service - freeswitch
   Loaded: loaded (/lib/systemd/system/freeswitch.service; enabled)
   Active: failed (Result: start-limit) since Sun 2018-01-07 16:28:38
UTC; 1s ago
  Process: 7900 ExecStartPre=/bin/mkdir -p /var/run/freeswitch/
(code=exited, status=214/SETSCHEDULER)
Jan 07 16:28:38 jessie systemd[1]: Failed to start freeswitch.
Jan 07 16:28:38 jessie systemd[1]: Unit freeswitch.service entered
failed state.
Jan 07 16:28:38 jessie systemd[1]: freeswitch.service holdoff time over,
scheduling restart.
Jan 07 16:28:38 jessie systemd[1]: Stopping freeswitch...
Jan 07 16:28:38 jessie systemd[1]: Starting freeswitch...
Jan 07 16:28:38 jessie systemd[1]: freeswitch.service start request
repeated too quickly, refusing to start.
Jan 07 16:28:38 jessie systemd[1]: Failed to start freeswitch.
Jan 07 16:28:38 jessie systemd[1]: Unit freeswitch.service entered
failed state.
#journalctl -xe
Jan 07 16:28:38 jessie systemd[1]: Starting freeswitch...
-- Subject: Unit freeswitch.service has begun with start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit freeswitch.service has begun starting up.
Jan 07 16:28:38 jessie systemd[7900]: Failed at step SETSCHEDULER
spawning /bin/mkdir: Operation not permitted
-- Subject: Process /bin/mkdir could not be executed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- The process /bin/mkdir could not be executed and failed.
--
-- The error number returned while executing this process is 1.
Jan 07 16:28:38 jessie systemd[1]: freeswitch.service: control process
exited, code=exited status=214
Jan 07 16:28:38 jessie systemd[1]: Failed to start freeswitch.
-- Subject: Unit freeswitch.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit freeswitch.service has failed.
--
-- The result is failed.
The startup script is,
# cat /lib/systemd/system/freeswitch.service
[Unit]
Description=freeswitch
After=syslog.target network.target local-fs.target postgresql.service
[Service]
; service
Type=forking
PIDFile=/run/freeswitch/freeswitch.pid
Environment="DAEMON_OPTS=-nonat"
EnvironmentFile=-/etc/default/freeswitch
ExecStartPre=/bin/mkdir -p /var/run/freeswitch/
ExecStartPre=/bin/chown -R www-data:www-data /var/run/freeswitch/
ExecStart=/usr/bin/freeswitch -u www-data -g www-data -ncwait $DAEMON_OPTS
TimeoutSec=45s
Restart=always
; exec
User=root
Group=daemon
LimitCORE=infinity
LimitNOFILE=100000
LimitNPROC=60000
LimitSTACK=250000
LimitRTPRIO=infinity
LimitRTTIME=infinity
IOSchedulingClass=realtime
IOSchedulingPriority=2
CPUSchedulingPolicy=rr
CPUSchedulingPriority=89
Given that it's reporting a scheduler problem, it's likely that one (or more)
of the 4 keys above at the problem as some of those actions won't be
allowed in a container.

You could edit the unit and comment those, then run "systemctl daemon-reload"
and try starting the service again.

If that does the trick, then you should be able to make this cleaner by
using a systemd unit override file instead.
Post by Stéphane Graber
Post by Rajil Saraswat
UMask=0007
[Install]
WantedBy=multi-user.target
Any idea how to fix this?
Thanks
_______________________________________________
lxc-users mailing list
http://lists.linuxcontainers.org/listinfo/lxc-users
--
Stéphane Graber
Ubuntu developer
http://www.ubuntu.com
_______________________________________________
lxc-users mailing list
http://lists.linuxcontainers.org/listinfo/lxc-users
--
Stéphane Graber
Ubuntu developer
http://www.ubuntu.com
Rajil Saraswat
2018-01-08 05:31:32 UTC
Permalink
Post by Stéphane Graber
Given that it's reporting a scheduler problem, it's likely that one (or more)
of the 4 keys above at the problem as some of those actions won't be
allowed in a container.
You could edit the unit and comment those, then run "systemctl daemon-reload"
and try starting the service again.
If that does the trick, then you should be able to make this cleaner by
using a systemd unit override file instead.
Commenting out the following worked,

#IOSchedulingClass=realtime
#IOSchedulingPriority=2
#CPUSchedulingPolicy=rr

Thanks for your help.
Pierre Couderc
2018-03-10 09:00:56 UTC
Permalink
Post by Rajil Saraswat
Post by Stéphane Graber
Given that it's reporting a scheduler problem, it's likely that one (or more)
of the 4 keys above at the problem as some of those actions won't be
allowed in a container.
You could edit the unit and comment those, then run "systemctl daemon-reload"
and try starting the service again.
If that does the trick, then you should be able to make this cleaner by
using a systemd unit override file instead.
Commenting out the following worked,
#IOSchedulingClass=realtime
#IOSchedulingPriority=2
#CPUSchedulingPolicy=rr
Sure, it works.
Thank you, Rajil, Stéphane, you help me fine as I have the same problem.
But at the cost of IOSchedulingClass not realtime.
This may be a problem with freeswitch.

Is there a way to parametrize the container so that
IOSchedulingClass=realtime is OK ?

Loading...