Well, what I’m doing is just an upgrade from 5.0.1 to 5.0.7 on the same RHEL 7.4 server. So it’s still strange that the systemd environment config files has changed.
Actually, I have found that the new systemd unit file (/usr/lib/systemd/system/kamailio.service) contains the location for this file:
[Unit]
Description=Kamailio (OpenSER) - the Open Source SIP Server
After=network.target mysql.service
[Service]
Type=simple
User=kamailio
Group=daemon
Environment='CFGFILE=/etc/kamailio/kamailio.cfg'
Environment='SHM_MEMORY=1024'
Environment='PKG_MEMORY=8'
EnvironmentFile=-/etc/sysconfig/kamailio
ExecStart=/usr/sbin/kamailio -DD -P /var/run/kamailio/kamailio.pid -f $CFGFILE -m $SHM_MEMORY -M $PKG_MEMORY
Restart=on-failure
[Install]
WantedBy=multi-user.target
The error seen in the kamailio log was <<< ERROR: jsonrpcs [jsonrpcs_fifo.c:82]: jsonrpc_init_fifo_server(): Failed to change the owner/group for /var/run/kamailio/kamailio_rpc_fifo to 248.248; Operation not permitted[1]>>>>
To configure the USER and GROUP at the right place is the solution. I had just to know at which place, in which config file….
As you said, redefine these 2 parameters in the systemd unit file is correct.
Before I see your last answer, I had found these parameters n the new systemd unit file above. but not with the value I had before the upgrade and set in the /etc/default/kamailio config file.
User=kamailio
Group=daemon
I have changed to GROUP=daemon to GROUP=kamailio, and now kamailio starts.
So this means for me those parameters in the systemd unit file are used by jsonrpcs to do the owner/group change on /var/run/kamailio/kamailio_rpc_fifo file.
It’s a quick manner to fix the problem, and probably, there are better solution (drop-in file etc… I have to learn about it).
Now, I have never manually configured the USER/GROUP params when I installed the 5.0.1 the very first installation on my RHEL 7.4.
Also I still have difficulties to understand why the upgrade to 5.0.7 has caused to me such problem, why it has not preserved the 5.0.1 settings.
Cordialement.
Patrick GINHOUX
Unisys | +33 1 46 69 52 12 | +33 6 60 32 24 74 | patrick.ginhoux@unisys.com
De : sr-users <sr-users-bounces@lists.kamailio.org> De la part de Sergey Safarov
Envoyé : mercredi 8 août 2018 20:17
À : Kamailio (SER) - Users Mailing List <sr-users@lists.kamailio.org>
Objet : Re: [SR-Users] Questions about changes between 5.0.1 and 5.0.7
ср, 8 авг. 2018 г. в 16:25, Ginhoux, Patrick <patrick.ginhoux@fr.unisys.com>:
Well I applied that appropriate values in the /etc/sysconfig/kamailio ( previously set in the /etc/default/Kamailio).
RHEL, CentOS and Fedora dists is used different location for systemd environment config files. Other then Debian based.
In this new file I can see less parameters than before. There are only 3 parameters : SHM_MEMORY/PKG_MEMORY/DUMP_CORE.
In the previous file there were also these 2 parameters :
# User to run as
USER=kamailio
# Group to run as
GROUP=kamailio
This setting is not configurable via /etc/sysconfig/kamailio file. You can redefine used and group using drop-in file or redefine whole systemd unit file in /etc/systemd/system folder.
Where can I find those 2 parameters now as it could explain the jsonrpcs issue ?
Please read systemd unit man files. You will be able redefine user and group.
Think this params not related to jsonrpcs.
You ask me to open a ticket for the jsonprcs issue, but I don’t know how to proceed. Usually I send mail to the users list.
I cannot help you in this
Sergey
Cordialement.
Patrick GINHOUX
Unisys | +33 1 46 69 52 12 | +33 6 60 32 24 74 | patrick.ginhoux@unisys.com
De : sr-users <sr-users-bounces@lists.kamailio.org> De la part de Sergey Safarov
Envoyé : mercredi 8 août 2018 14:29
À : Kamailio (SER) - Users Mailing List <sr-users@lists.kamailio.org>
Objet : Re: [SR-Users] Questions about changes between 5.0.1 and 5.0.7
Now this settings located at
EnvironmentFile=-/etc/sysconfig/kamailio
Example you can see at
https://github.com/kamailio/kamailio/blob/master/pkg/kamailio/obs/kamailio.sysconfig
Need uncomment and set required values
About json issue please fill a ticket.
Sergey
ср, 8 авг. 2018 г. в 11:50, Ginhoux, Patrick <patrick.ginhoux@fr.unisys.com>:
Well, previously we changed the memory allocated in the <<<< /etc/default/kamailio >>>> config file :
#
# Kamailio startup options
#
# Set to yes to enable kamailio, once configured properly.
RUN_KAMAILIO=yes
# User to run as
USER=kamailio
# Group to run as
GROUP=kamailio
# Amount of shared memory to allocate for the running Kamailio server (in Mb)
SHM_MEMORY=1024
# Amount of private memory to allocate for the running Kamailio server (in Mb)
PKG_MEMORY=8
# Enable the server to leave a core file when it crashes.
# Set this to 'yes' to enable kamailio to leave a core file when it crashes
# or 'no' to disable this feature. This option is case sensitive and only
# accepts 'yes' and 'no' and only in lowercase letters.
# On some systems (e.g. Ubuntu 6.10, Debian 4.0) it is necessary to specify
# a directory for the core files to get a dump. Look into the kamailio
# init file for an example configuration.
DUMP_CORE=no
# Add extra command line parameters in the EXTRA_OPTIONS variable
# EXTRA_OPTIONS="-a no"
Now such changes need to be applied in the new service unit file <<<< /usr/lib/systemd/system/kamailio.service >>>> :
Description=Kamailio (OpenSER) - the Open Source SIP Server
After=network.target mysql.service
[Service]
Type=simple
User=kamailio
Group=daemon
Environment='CFGFILE=/etc/kamailio/kamailio.cfg'
Environment='SHM_MEMORY=1024'
Environment='PKG_MEMORY=8'
EnvironmentFile=-/etc/sysconfig/kamailio
ExecStart=/usr/sbin/kamailio -DD -P /var/run/kamailio/kamailio.pid -f $CFGFILE -m $SHM_MEMORY -M $PKG_MEMORY
Restart=on-failure
[Install]
WantedBy=multi-user.target
That’s all changes I’ve seen.
But now my kamailio doesn’t start due to jsonpcs issue I describe in my initial thread : [SR-Users] kamcmd htable.reload propertiesHash problem.
Cordialement.
Patrick GINHOUX
Unisys | +33 1 46 69 52 12 | +33 6 60 32 24 74 | patrick.ginhoux@unisys.com
De : sr-users <sr-users-bounces@lists.kamailio.org> De la part de Sergey Safarov
Envoyé : mercredi 8 août 2018 10:29
À : Kamailio (SER) - Users Mailing List <sr-users@lists.kamailio.org>
Objet : Re: [SR-Users] Questions about changes between 5.0.1 and 5.0.7
Kamailio is upgraded.
Check old config at kamailio.rpmsave
ср, 8 авг. 2018 г., 10:02 Ginhoux, Patrick <patrick.ginhoux@fr.unisys.com>:
Sergey,
I have successfully downloaded the new stream for 5.0.7 that is now 5.0.7-7 (previously 5.0.7-1).
Then after restoring my Kamailio server before the initial upgrade with 5.0.7-1, I have upgraded it with the 5.0.7-7 packages.
Now there is no more dependencies with the mod_perl package (good job) but only with the kamailio-ims package I’ve already seen:
[root@vm-siprouter74 kamailio-5.0.7-7]# ll
total 5484
-rw------- 1 root root 5368448 Aug 7 21:05 kamailio-5.0.7-7.el7.x86_64.rpm
-rw------- 1 root root 75208 Aug 7 21:05 kamailio-mysql-5.0.7-7.el7.x86_64.rpm
-rw------- 1 root root 81516 Aug 7 21:05 kamailio-perl-5.0.7-7.el7.x86_64.rpm
-rw------- 1 root root 84096 Aug 7 21:05 kamailio-snmpstats-5.0.7-7.el7.x86_64.rpm
[root@vm-siprouter74 kamailio-5.0.7-7]# rpm -Uvh *
warning: kamailio-5.0.7-7.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 941fdbdd: NOKEY
error: Failed dependencies:
libkamailio_ims.so.0()(64bit) is needed by kamailio-5.0.7-7.el7.x86_64
Adding the kamailio-ims-5.0.7-7.el7 package get rid of this :
[root@vm-siprouter74 kamailio-5.0.7-7]# rpm -Uvh *
warning: kamailio-5.0.7-7.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 941fdbdd: NOKEY
Preparing... ################################# [100%]
Updating / installing...
1:kamailio-ims-5.0.7-7.el7 ################################# [ 11%]
2:kamailio-5.0.7-7.el7 warning: /etc/kamailio/kamailio.cfg created as /etc/kamailio/kamailio.cfg.rpmnew
warning: /etc/kamailio/kamctlrc created as /etc/kamailio/kamctlrc.rpmnew
################################# [ 22%]
3:kamailio-mysql-5.0.7-7.el7 ################################# [ 33%]
4:kamailio-perl-5.0.7-7.el7 ################################# [ 44%]
5:kamailio-snmpstats-5.0.7-7.el7 ################################# [ 56%]
Cleaning up / removing...
6:kamailio-snmpstats-5.0.1-1.1 ################################# [ 67%]
7:kamailio-perl-5.0.1-1.1 ################################# [ 78%]
8:kamailio-mysql-5.0.1-1.1 ################################# [ 89%]
9:kamailio-5.0.1-1.1 warning: /etc/rc.d/init.d/kamailio saved as /etc/rc.d/init.d/kamailio.rpmsave
################################# [100%]
warning: /etc/default/kamailio saved as /etc/default/kamailio.rpmsave
Any comments on this upgrade and the kamailio-ims dependencies?
Cordialement.
Patrick GINHOUX
Unisys | +33 1 46 69 52 12 | +33 6 60 32 24 74 | patrick.ginhoux@unisys.com
De : sr-users <sr-users-bounces@lists.kamailio.org> De la part de Sergey Safarov
Envoyé : mardi 7 août 2018 18:38
À : Kamailio (SER) - Users Mailing List <sr-users@lists.kamailio.org>
Objet : Re: [SR-Users] Questions about changes between 5.0.1 and 5.0.7
We still have not resolved issue with RPM build service.
But you can try download from https://download.opensuse.org/repositories/home:/kamailio:/v5.0.x-rpms/RHEL_7/
after 40 min
вт, 7 авг. 2018 г. в 17:30, Ginhoux, Patrick <patrick.ginhoux@fr.unisys.com>:
Sergey,
Good to know that mistake and that there is a fixed. Do you know if there is a new Kamailio-perl rpm available ?
Cordialement.
Patrick GINHOUX
Unisys | +33 1 46 69 52 12 | +33 6 60 32 24 74 | patrick.ginhoux@unisys.com
De : sr-users <sr-users-bounces@lists.kamailio.org> De la part de Sergey Safarov
Envoyé : mardi 7 août 2018 13:51
À : Kamailio (SER) - Users Mailing List <sr-users@lists.kamailio.org>
Objet : Re: [SR-Users] Questions about changes between 5.0.1 and 5.0.7
Typo
Correct
mod_perl and mod_perl-devel dependency is added by mistake. PR is fixed this
About package moving between repos please ask RHEL support team. RHEL is drives this process.
Sergey.
вт, 7 авг. 2018 г. в 14:49, Sergey Safarov <s.safarov@gmail.com>:
I mod_perl and mod_perl-devel dependency is added by mistake. PR is fixed this
About package moving between repos please as RHEL support team. RHEL is drives this process.
Sergey.
вт, 7 авг. 2018 г. в 14:43, Ginhoux, Patrick <patrick.ginhoux@fr.unisys.com>:
Hi Sergey,
Thanks for the link that shows the mod_perl use.
But I’m interested to understand why such change between the 5.0.1 and 5.0.7 level. And also why the use of mod_perl which is removed from official distro.
Cordialement.
Patrick GINHOUX
Unisys | +33 1 46 69 52 12 | +33 6 60 32 24 74 | patrick.ginhoux@unisys.com
De : sr-users <sr-users-bounces@lists.kamailio.org> De la part de Sergey Safarov
Envoyé : mardi 7 août 2018 11:37
À : Kamailio (SER) - Users Mailing List <sr-users@lists.kamailio.org>
Objet : Re: [SR-Users] Questions about changes between 5.0.1 and 5.0.7
Hello Patrick
Please review packaging PR https://github.com/kamailio/kamailio/pull/1615
вт, 7 авг. 2018 г. в 9:52, Ginhoux, Patrick <patrick.ginhoux@fr.unisys.com>:
Hi,
Following a problem with the kamcmd htable.reload with Kamailio 5.0.1 (see related thread for this), I have upgraded to the 5.0.7 level (with some difficulties due to my specific environment).
My server runs the RHEL 7.4 distribution.
Now the upgrade is complete, I notice that that are changes not really documented:
- The kamailio-perl-5.0.7-1.el7.x86_64.rpm requires to install the mod_perl module that doesn’t exist anymore in RHEL 7. It needs to be installed from the EPEL repository
- The init script for kamailio has been changed from the old method to the fully compliant method for system unit for RHEL 7 for example:
With the 5.0.1 level we have the “/etc/rc.d/init.d/kamailio”
With the 5.0.7 level we have now the “/usr/lib/systemd/system/kamailio.service”
So my questions/comments are :
- Why the mod_perl module is required between 5.0.1 and 5.0.7 (question posted in the attached message) ?
- In the previous kamailo init script, I added a condition to start MySQL before kamailio by adding this entry in the script : # Required-Start: $syslog $network $mysqld
The new script contains the After command :
[Unit]
Description=Kamailio (OpenSER) - the Open Source SIP Server
After=network.target
Should I change the After line with this : After=network.target mysql.target to have the same condition?
In all the cases, some documentation must be changed to provide more details.
Thanks in advance for the answers.
Cordialement.
Patrick GINHOUX
_______________________________________________
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users_______________________________________________
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users_______________________________________________
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users_______________________________________________
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users_______________________________________________
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users_______________________________________________
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users