[SR-Users] systemd - properly starting up rtpengine with kernel forwarding

Daniel-Constantin Mierla miconda at gmail.com
Fri Jan 17 15:01:11 CET 2020


Hello,

do people here have (implemented) special ways to properly start
rtpengine with kernel forwarding after system reboot?

>From rtpengine readme:

"""

A typical start-up sequence including in-kernel forwarding might look
like this:

# this only needs to be one once after system (re-) boot
modprobe xt_RTPENGINE
iptables -I INPUT -p udp -j RTPENGINE --id 0
ip6tables -I INPUT -p udp -j RTPENGINE --id 0

# ensure that the table we want to use doesn't exist - usually needed
after a daemon
# restart, otherwise will error
echo 'del 0' > /proc/rtpengine/control

# start daemon
/usr/sbin/rtpengine --table=0 --interface=10.64.73.31
--interface=2001:db8::4f3:3d \
--listen-ng=127.0.0.1:2223 --tos=184 --pidfile=/run/rtpengine.pid
--no-fallback

"""

I was relying on shell scripts executed on boot time, but now that
systemd is more common, I am looking to see what are
"standard"/"recommended" ways for running additional scripts besides the
start/stop daemon, which makes it also easier to build packages not
worrying about the type of OS and how it can run scripts at startup.

Systemd seems to have the "ExecStartPre" option, is it what people use
to ensure the rtpengine kernel module is loaded and iptables rule exists?

Any systemd-specific wayt to run a script only once after system boot? I
have seen workarounds on the net for creating like a rc.local service,
but they didn't look to be systemd-native, ...

Not strictly related, but if someone is aware or had some experiences
with,  I am curious if "echo 'del 0' > /proc/rtpengine/control" is
really needed because on a system where I forgot to have it in the
scripts (well, was commented), I haven't noticed any issues after
rtpengine restarts.

Cheers,
Daniel

-- 
Daniel-Constantin Mierla -- www.asipto.com
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio World Conference - April 27-29, 2020, in Berlin -- www.kamailioworld.com




More information about the sr-users mailing list