Hi, To take even more benefits from systemd, here's our live enviroment systemd file. Pay attention of the filename "[email protected]", which takes config file name as variable %i. Very useful and handy, when running multiple instances of radiator.
$ systemctl enable radius@accounting $ systemctl start radius@accounting This starts radiusd with accounting.cfg. As the radiator uses mysql db, the mysql.service is required. Otherwise it can be omitted. $ cat /etc/systemd/system/[email protected] [Unit] After=network-online.target mysql.service Wants=network-online.target mysql.service [Service] Type=simple Restart=on-failure TimeoutSec=10 User=radius ExecStart=/usr/bin/radiusd -foreground -config_file /etc/radius/%i.cfg [Install] WantedBy=multi-user.target The only thing I'm missing in systemd, is to somehow pass SIGUSR1/SIGUSR2 (traceup/tracedown) to existing process. Half automated alternative I use is: $ kill -USR2 `pgrep -f accounting` kind regards, -- rauno On 26.07.2017 15:51, Hartmaier Alexander wrote: > The service file in goodies is *very* suboptimal as it uses pid files > which is one of the major benefits of systemd not requiring those and > monitoring processes directly. > > Here is ours: > > # radiator-aaa.service > # > # Systemd script for Radiator RADIUS Server > # Copy this script to /lib/systemd/system > # and run from console: systemctl enable radiator-aaa.service > # > # Copy this file to a different name and edit the [Service] > # variables to run multiple radiusd instances. Make sure > # PIDFile is different for each instance. > # > > [Unit] > Description=Radiator-AAA > > # Make sure your databases and other services required by > # Radiator are running before radiusd starts > After=syslog.target > After=network.target > > [Service] > RuntimeDirectory=radiator-aaa > > # Use RADIATOR_ARGS to add any command line arguments such as name=value > # global variables or -I for local installation directory > Environment="RADIATOR_ARGS=" > Environment="RADIATOR_CONFIG=/etc/radiator-aaa/radius.cfg" > # to log in UTC, also the startup message which is logged before > StartupHook > Environment="TZ=UTC" > > User=radiator > > # If process dies it will be automatically restarted > Restart=always > > ExecStart=/home/radiator/perl5/perlbrew/perls/RADIATOR-Debian8-Perl5.22/bin/perl > > /home/radiator/perl5/perlbrew/perls/RADIATOR-Debian8-Perl5.22/bin/radiusd > -foreground -config_file $RADIATOR_CONFIG $RADIATOR_ARGS > > [Install] > WantedBy=multi-user.target > > > @Tuure: would be great if you update the service file in goodies. > > Best regards, Alex > > On 2017-07-25 18:14, Eric W. Bates wrote: >> perfect. Thank you. >> >> On 7/25/2017 11:03 AM, Tuure Vartiainen wrote: >>> Hi Eric, >>> >>>> On 25 Jul 2017, at 17.29, Eric W. Bates <[email protected]> wrote: >>>> >>>> Anyone written a systemd unit file for radiator? >>>> >>> you can find one example from goodies/radiator.service >>> >>> >>> BR >>> -- >>> Tuure Vartiainen <[email protected]> >>> >>> Radiator: the most portable, flexible and configurable RADIUS server >>> anywhere. SQL, proxy, DBM, files, LDAP, NIS+, password, NT, Emerald, >>> Platypus, Freeside, TACACS+, PAM, external, Active Directory, EAP, TLS, >>> TTLS, PEAP, TNC, WiMAX, RSA, Vasco, Yubikey, MOTP, HOTP, TOTP, >>> DIAMETER etc. Full source on Unix, Windows, MacOSX, Solaris, VMS, >>> NetWare etc. >>> >>> >>> >>> _______________________________________________ >>> radiator mailing list >>> [email protected] >>> http://lists.open.com.au/mailman/listinfo/radiator >>> > > > > *"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"* > > T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien > Handelsgericht Wien, FN 79340b > *"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"* > > Notice: This e-mail contains information that is confidential and may be > privileged. > If you are not the intended recipient, please notify the sender and then > delete this e-mail immediately. > *"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"* > > _______________________________________________ > radiator mailing list > [email protected] > http://lists.open.com.au/mailman/listinfo/radiator _______________________________________________ radiator mailing list [email protected] http://lists.open.com.au/mailman/listinfo/radiator
