Hi, Alex!

OpenSIPS tries to write the file in the working directory, that is by default the home of the running user, opensips. Apparently he's not allowed to create the file there. You have 3 solutions:
1. make the working directory writable
2. specify a new work directory (using the -w parameter)
3. Specify a full path for the restart_persistency_cache_file[1]

[1] https://www.opensips.org/Documentation/Script-CoreParameters-3-1#toc58

Best regards,

Răzvan Crainea
OpenSIPS Core Developer
http://www.opensips-solutions.com

On 10/14/20 3:57 PM, Alex A wrote:
Bump on this one
On Sep 29, 2020, at 3:15 PM, Alex A <[email protected] <mailto:[email protected]>> wrote:

    Hi Everyone,

    I am running into an issue getting the restart_persistency working
    on CentOS Linux release 7.7.1908
    Was hoping to get any pointers to further troubleshooting.

    As soon as I enable these 2 lines:

        restart_persistency_size = 512
        modparam("drouting", "enable_restart_persistency", yes)


    Opensips service fails to start.  Opensips is installed from nightly
    opensips repo:

        [opensips-cli-nightly]
        name=OpenSIPS CLI tool - Open Source SIP proxy/server for el7 -
        $basearch
        baseurl=https://yum.opensips.org/cli/nightly/el/7/noarch

    opensips -V
    version: opensips 3.1.0 (x86_64/linux)
    flags: STATS: On, DISABLE_NAGLE, USE_MCAST, SHM_MMAP, PKG_MALLOC,
    Q_MALLOC, F_MALLOC, HP_MALLOC, DBG_MALLOC, FAST_LOCK-ADAPTIVE_WAIT
    ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN
    16, MAX_URI_SIZE 1024, BUF_SIZE 65535
    poll method support: poll, epoll, sigio_rt, select.
    git revision: be33f6864
    main.c compiled on 01:43:57 Sep 26 2020 with gcc 4.8.5


    Opensips daemon, runs as opensips user:

        cat /usr/lib/systemd/system/opensips.service

        [Unit]
        Description=OpenSIPS is a very fast and flexible SIP (RFC3261)
        server
        Documentation=man:opensips
        After=network.target mysqld.service postgresql.service
        rtpproxy.service

        [Service]
        Type=forking
        User=opensips
        Group=opensips
        RuntimeDirectory=opensips
        RuntimeDirectoryMode=775
        Environment=P_MEMORY=32 S_MEMORY=32
        EnvironmentFile=-/etc/sysconfig/opensips
        PermissionsStartOnly=yes
        PIDFile=%t/opensips/opensips.pid
        ExecStart=/usr/sbin/opensips -P %t/opensips/opensips.pid -f
        /etc/opensips/opensips.cfg -m $S_MEMORY -M $P_MEMORY $OPTIONS
        ExecStop=/usr/bin/pkill --pidfile %t/opensips/opensips.pid
        Restart=always
        TimeoutStopSec=30s
        LimitNOFILE=262144

        [Install]
        WantedBy=multi-user.target



    There is a permissions error that pops up when running "service
    opensips start":

    Sep 29 08:33:48 testBox opensips: Sep 29 08:33:48 [7016]
    INFO:drouting:dr_init: dynamic routing - initializing
    Sep 29 08:33:48 testBox opensips: Sep 29 08:33:48 [7016]
    INFO:core:init_rpm_mallocs: using 512 Mb of restart persistent
    shared memory
    Sep 29 08:33:48 testBox opensips: Sep 29 08:33:48 [7016]
    ERROR:core:init_rpm_mallocs: could not create the restart
    persistency memory file .restart_persistency.cache (13: Permission
    denied)
    Sep 29 08:33:48 testBox opensips: Sep 29 08:33:48 [7016]
    ERROR:core:rpm_init_mem: could not initialize restart persistent memory!
    Sep 29 08:33:48 testBox opensips: Sep 29 08:33:48 [7016]
    ERROR:drouting:dr_init: could not initilize restart persistency memory!


    The daemon start works in debug mode as a root and as opensips user
    (opensips -D);
      however fails start with startup scripts.

    The permissions on the /etc/opensips directory are as follows:
    opensips# ls -aXlt
    total 1708
    drwxrwxrwx   3 opensips opensips      4096 Sep 29 08:25
    .                     (/etc/opensips directory)
    drwxr-xr-x. 78 root     root          4096 Sep 28 21:48
    ..                           (/etc/ directory)
    -rwxrwxrwx   1 opensips opensips     11673 Sep 28 20:51 opensips.cfg
    drwxrwxrwx   4 opensips opensips      4096 Sep 26 16:40 tls
    -rwxrwxrwx   1 opensips opensips      1674 Sep 25 19:45
    dictionary.opensips
    -rwxrwxrwx   1 opensips opensips       500 Sep  6 13:27 opensips-cli.cfg



    It looks like the full permissions to opensips user are allowed on
    the home directory, however writing of this file still fails as
    systemV service

    Is there anything else that I can check?




    Any pointers would be greatly appreciated.

    Thank you.


_______________________________________________
Users mailing list
[email protected]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


_______________________________________________
Users mailing list
[email protected]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

Reply via email to